//js code to get dcp acp img pdf tab content (() => { const text1 = Array.from(document.querySelectorAll(".tab-content img")) .filter(img => img.src) .map(img => img.src.split("/").pop()) .filter(name => !/call|mobile|email/i.test(name)) .join("\n"); const text2 = Array.from( document.querySelectorAll(".tab-content .map-wrapper > a")) .filter(a => a.href) .map(a => a.href.split("/").pop()) .filter(name => /\.pdf$/i.test(name)) // sirf PDF files .join("\n"); const data = "Images" + "\n" + "-----------------" + "\n\n" + text1 + "\n\n" + "pdf files" + "\n\n" + "-----------------" + "\n\n" + text2; // TAB CONTENT cards const cards_tabcontent = document.querySelectorAll( ".tab-content .tab-pane .map-contact-card" ); // DCP / ACP cards (FIXED selector formatting) const cards_dcp_acp = document.querySelectorAll( ".map-contacts-container .map-contact-card.du .map-contact-info, " + ".map-contacts-container .map-contact-card.du .map-contact-name" ); if (!cards_tabcontent.length) { alert("Koi map-contact-card nahi mila"); return; } // Groups const groups = { TEXT_TABCONTENT: [], MOBILE_TABCONTENT: [], LANDLINE_TABCONTENT: [], EMAIL_TABCONTENT: [], TEXT_DCPACP: [], MOBILE_DCPACP: [], LANDLINE_DCPACP: [], EMAIL_DCPACP: [], }; // ---------- TAB CONTENT ---------- Array.from(cards_tabcontent).forEach(card => { const lines = card.innerText .split("\n") .map(t => t.trim()) .filter(Boolean) .filter((v, i, arr) => arr.indexOf(v) === i); lines.forEach(line => { if (/\[at\]|\[dot\]|@/i.test(line)) { groups.EMAIL_TABCONTENT.push(line); } else if (/^[6-9]\d{9}$/.test(line)) { groups.MOBILE_TABCONTENT.push(line); } else if (/^0\d{2,4}-\d{6,8}$/.test(line)) { groups.LANDLINE_TABCONTENT.push(line); } else { groups.TEXT_TABCONTENT.push(line); } }); }); // ---------- DCP / ACP ---------- Array.from(cards_dcp_acp).forEach(card => { const lines = card.innerText .split("\n") .map(t => t.trim()) .filter(Boolean) .filter((v, i, arr) => arr.indexOf(v) === i); lines.forEach(line => { if (/\[at\]|\[dot\]|@/i.test(line)) { groups.EMAIL_DCPACP.push(line); } else if (/^[6-9]\d{9}$/.test(line)) { groups.MOBILE_DCPACP.push(line); } else if (/^0\d{2,4}-\d{6,8}$/.test(line)) { groups.LANDLINE_DCPACP.push(line); } else { groups.TEXT_DCPACP.push(line); } }); }); // ---------- OUTPUT ---------- let output = ` === TAB CONTENT GROUP === -- DESIGNATION -- ${groups.TEXT_TABCONTENT.join("\n")} -- MOBILE -- ${groups.MOBILE_TABCONTENT.join("\n")} -- LANDLINE -- ${groups.LANDLINE_TABCONTENT.join("\n")} -- EMAIL -- ${groups.EMAIL_TABCONTENT.join("\n")} === DCP / ACP GROUP === -- DESIGNATION -- ${groups.TEXT_DCPACP.join("\n")} -- MOBILE -- ${groups.MOBILE_DCPACP.join("\n")} -- LANDLINE -- ${groups.LANDLINE_DCPACP.join("\n")} -- EMAIL -- ${groups.EMAIL_DCPACP.join("\n") } `; output += "\n\n" + " pdf and image " + "\n\n" + data; // ---------- COPY TO CLIPBOARD ---------- const textarea = document.createElement("textarea"); textarea.value = output; document.body.appendChild(textarea); textarea.select(); document.execCommand("copy"); document.body.removeChild(textarea); alert("Mobile, Landline, Email alag-alag group me copy ho gaye ✅"); })();