feat: remove timeout
This commit is contained in:
@@ -1,13 +1,10 @@
|
|||||||
import { PlaywrightCrawler, Configuration } from 'crawlee';
|
import { PlaywrightCrawler, Configuration } from 'crawlee';
|
||||||
|
|
||||||
async function scrapeData(url, selectors, waitForSeconds = 2) {
|
async function scrapeData(url, selectors) {
|
||||||
const scrapedData = [];
|
const scrapedData = [];
|
||||||
const crawler = new PlaywrightCrawler({
|
const crawler = new PlaywrightCrawler({
|
||||||
requestHandler: async ({ page, request }) => {
|
requestHandler: async ({ page, request }) => {
|
||||||
await page.goto(url);
|
await page.goto(url);
|
||||||
|
|
||||||
await page.waitForTimeout(waitForSeconds * 1000);
|
|
||||||
|
|
||||||
console.log('Received selectors:', selectors);
|
console.log('Received selectors:', selectors);
|
||||||
|
|
||||||
for (const selector of selectors) {
|
for (const selector of selectors) {
|
||||||
|
|||||||
Reference in New Issue
Block a user