other-emerald•2y ago
How to cron with Playwright
Few days ago i was trying to implement a cron when i was scraping, but when the code make the second run it hits 0 url, and i figured out how to do this and in every re-run hit all the urls,
I create at the same level of the main.ts one file called start.ts
then i move the package.json to start that file like this :
and in the start.ts i put this code
with this code we can manage the cron and all the execution will end with all the url, and avoiding the error that makes the crawler reach 0 url
1 Reply
expected usesage is
apify run -p
so SDK client will delete existing dataset and request queue. otherwise its restart for lareaady crawled requests and unless you manage it by some logic requests considered as laready resolved and handler function skipped.