Skip to content

Instantly share code, notes, and snippets.

@4e6ka
Created February 24, 2025 02:15
Show Gist options
  • Save 4e6ka/82b71575b9580a3c5d936dc1c90e50bc to your computer and use it in GitHub Desktop.
Save 4e6ka/82b71575b9580a3c5d936dc1c90e50bc to your computer and use it in GitHub Desktop.
ggl parse domains
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();
@4e6ka
Copy link
Author

4e6ka commented Feb 24, 2025

Вставить в конcоль на странице /searchSites, получим все отобранные сайты по фильтрам, дальше можно в чектраст или кейс.со
Нужно для формирования вайт-листов

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment