puppeteer/replay
Hi, all, nice to see you.
I have a question about how I would use
puppeteer/replay
in PuppeteerCrawler for executing scenario generated on Chrome Recorder.
What I want to do is that, before executing crawling, function is called on each scenario step.
I tried it, not using PuppeteerCrawler.
But I'm not sure how it is integrated with PuppeteerCrawler.
Below is a current simple example.
Is there anyone who has any ideas?
Thank you.
5 Replies
continuing-cyanâ˘3y ago
What is
LoginScenarioReplay(...)
?
You export recorder script as JSON File?yelping-magentaOPâ˘3y ago
Sorry, I forgot to rename itđ˘
I have changed.
continuing-cyanâ˘3y ago
What do you mean by "before executing the crawling, the function is called at each step of the scenario". Which function should be called?
yelping-magentaOPâ˘3y ago
I mean âright before crawling each path, the scenario should be executedâ like âbeforeEachStepâ of puppeteer/replay.
I couldnât find a way to do so with PuppeteerCrawler.
Thatâs the best to execute authenticating and crawling in each browser that has Basic Auth.
automatic-azureâ˘3y ago
You have crawler hooks https://crawlee.dev/api/browser-crawler/interface/BrowserCrawlerOptions#preNavigationHooks and then also browser pool hooks, those should give you fine control https://crawlee.dev/api/browser-pool/interface/BrowserPoolHooks#preLaunchHooks