diff --git a/scraper/src/scraper.js b/scraper/src/scraper.js index eebd61d9..40c976a7 100644 --- a/scraper/src/scraper.js +++ b/scraper/src/scraper.js @@ -6,22 +6,20 @@ async function scrapeData(url, selectors) { requestHandler: async ({ page, request }) => { await page.goto(url); console.log('Received selectors:', selectors); - for (const selector of selectors) { const elementData = await page.$$eval(selector, elements => elements.map(el => el.textContent.trim())); scrapedData.push(...elementData); } - console.log('Scraped data:', scrapedData); }, }, - new Configuration({ - persistStorage: false, - })); + new Configuration({ + persistStorage: false, + })); - await crawler.run([ url ]); + await crawler.run([url]); return scrapedData; - + } export default scrapeData; \ No newline at end of file