Created
February 24, 2025 02:15
-
-
Save 4e6ka/82b71575b9580a3c5d936dc1c90e50bc to your computer and use it in GitHub Desktop.
ggl parse domains
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const asyncInterval = async (callback, ms, triesLeft = 5) => { | |
return new Promise((resolve, reject) => { | |
const interval = setInterval(async () => { | |
if (await callback()) { | |
resolve(); | |
clearInterval(interval); | |
} else if (triesLeft <= 1) { | |
reject(); | |
clearInterval(interval); | |
} | |
triesLeft--; | |
}, ms); | |
}); | |
}; | |
let links = []; | |
const wrapper = async () => { | |
try { | |
await asyncInterval(async function () { | |
console.log('Runs..... '); | |
const tableLinks = $('.site-link > a'); | |
if (tableLinks.length === 0) { | |
console.log("Selector tableLinks is empty"); | |
return; | |
} | |
for (let selector of tableLinks) { | |
links.push($(selector).text()); | |
} | |
const pagen = $('.pagination > span').next(); | |
if (pagen.length === 0) { | |
console.error("Selector pagen is empty"); | |
return; | |
} | |
pagen.click(); | |
return; | |
}, 6000, 6); // 15 Кол. повторений (количество страниц с площадками) | |
} catch (e) { | |
console.log('End parse'); | |
console.log(links.join('\n')); | |
} | |
//console.log('Done'); | |
}; | |
wrapper(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Вставить в конcоль на странице /searchSites, получим все отобранные сайты по фильтрам, дальше можно в чектраст или кейс.со
Нужно для формирования вайт-листов