Playwright Scraper avatar
Playwright Scraper

Pricing

Pay per usage

Go to Store
Playwright Scraper

Playwright Scraper

apify/playwright-scraper

Developed by

Apify

Maintained by Apify

Crawls websites with the headless Chromium, Chrome, or Firefox browser and Playwright library using a provided server-side Node.js code. Supports both recursive crawling and a list of URLs. Supports login to a website.

4.3 (7)

Pricing

Pay per usage

31

Monthly users

137

Runs succeeded

98%

Response time

3.1 days

Last modified

10 months ago

CG

I can't seem to understand what is wrong with the code.

Closed
Cameryn_Gardner opened this issue
10 months ago

I have tried to correct the errors but can't understand what is wrong with the code...

jindrich.bar avatar

Hello and thank you for your interest in this Actor!

There are two issues with the Actor setup you're using. The one the Actor is complaining about - the preNavigationHooks are supposed to be an array of function "literals", not an array of stringified functions - see the screenshot attached below.

The other problem is that when preNavigationHooks are running, the page is in a "before-navigation" state - nothing is loaded yet. If you want to log in to the website, you have to move your logic to the postNavigationHooks. I also found out that the waitForNavigation call in the login function causes the actor to hang indefinitely, so I just removed it - but maybe I just didn't understand its importance.

I'll close this issue now, but feel free to ask any additional questions, if you have any. Cheers!

CG

Cameryn_Gardner

10 months ago

Thanks Jindřich for getting back to me.

I have applied the changes you suggested, but I am still having issues with the pre navigation hooks.

Please can I ask you to have a look at the log, here is the URL: https://console.apify.com/actors/MpRbnNmVAoj5RC1Ma/runs/j2unTmsHqS86FOzlr#log

Thank you for all your help.

Regards;

--

[image: Logo] https://www.battlebearmarketing.com/ Cameryn Gardner | CEO *a: *Battle Bear | Smith Rd | Bedfordview 2008 e: Cameryn@battlebearmarketing.com w: www.battlebearmarketing.com http://www.battlebearmarketing.com/ m: +27 68 297 6951 | p: +27 10 495 4914 [image: facebook icon] https://business.facebook.com/BattleBearMarketing/ [image: instagram icon] https://www.instagram.com/battle_bear_marketing/

Pricing

Pricing model

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage.