feat: remove cli arguments

This commit is contained in:
karishmas6
2024-04-19 01:04:57 +05:30
parent fe707f71d8
commit 614a600b90

View File

@@ -21,14 +21,4 @@ async function scrapeData(url, selectors, waitForSeconds = 2) {
});
await crawler.run([{ url }]);
}
const url = process.argv[2];
const selectors = process.argv.slice(3); // Selectors are passed as subsequent arguments
const waitForSeconds = parseInt(process.argv[selectors.length + 2] || 2); // Optional wait time
if (url && selectors.length > 0) {
await scrapeData(url, selectors, waitForSeconds);
} else {
console.error('Please provide URL and selectors as arguments.');
}