-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathpaste.js
More file actions
28 lines (19 loc) · 669 Bytes
/
paste.js
File metadata and controls
28 lines (19 loc) · 669 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const elementsToScrape = document.querySelectorAll("._ao3e");
const scrapedData = [];
const fileName = Date.now().toString()
elementsToScrape.forEach((element) => {
const data = element.textContent.trim();
if(data.startsWith('+55')) // change for your DDI
scrapedData.push(data);
});
let dataString = scrapedData.join("\n");
const blob = new Blob([dataString], { type: "text/plain" });
const url = URL.createObjectURL(blob);
const link = document.createElement("a");
link.href = url;
link.download = `${fileName}.txt`;
link.style.display = "none";
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(url);