Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Simpan data produk di https://shop.tiktok.com/ kedalam csv
- // contact t.me/mase89
- // Array untuk menyimpan data exposure key
- const data = [];
- // Seleksi semua elemen yang memiliki atribut `data-exposure-key`
- document.querySelectorAll('[data-exposure-key]').forEach(el => {
- const key = el.getAttribute('data-exposure-key');
- if (key) {
- // Format URL
- const url = `https://shop.tiktok.com/view/product/${key}?region=ID`;
- data.push(url);
- }
- });
- // Konversi array menjadi konten CSV
- const csvContent = "data:text/csv;charset=utf-8," + data.join("\n");
- // Buat dan klik elemen download untuk menyimpan file
- const encodedUri = encodeURI(csvContent);
- const link = document.createElement("a");
- link.setAttribute("href", encodedUri);
- link.setAttribute("download", "data_produk.csv");
- document.body.appendChild(link);
- link.click();
- document.body.removeChild(link);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement