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

142

Runs succeeded

98%

Response time

3.1 days

Last modified

10 months ago

II

the json tells me one thing the log gives me an error when i swap it to correct the json error

Closed
immovable_investigator opened this issue
7 months ago

i code json with preNavigationHooks as an array and the json checker flags it saying it must be a string. I correct it make it a damn string and the run fails whats the error you ask???? oh crap it says preNavigationHooks should be an array. Like no shit it should be an array! fix your shit man.

II

immovable_investigator

7 months ago

Field "preNavigationHooks" should be string

II

immovable_investigator

7 months ago

2024-08-22T20:17:55.130Z ERROR Input parameter "preNavigationHooks" is not an array!

jindrich.bar avatar

Hello and thank you for your interest in this Actor!

I apologize for the frustration this issue has caused.

The preNavigationHooks field in the Web Scraper actor expects a string in the JSON configuration. This string should contain the JavaScript code that specifies an array of functions. For example:

"preNavigationHooks": "[    async (crawlingContext) => {    console.log('first pre hook', crawlingContext.request.url);    },    async (crawlingContext) => {     console.log('pre hook2', crawlingContext.request.url);    }]"

At runtime, this string is evaluated to create the required array of functions. If the format is not correct, you may see errors like the ones you mentioned. Please ensure the input follows the format above to avoid these issues.

We’re working to make these requirements more consistent and user-friendly. For example, you can use the code editor on the Input tab in the Apify Console to set this up (and then just copy the JSON input to your script). The code editor provides a better user experience with code highlighting and automatic JavaScript syntax checking.

I’m closing this issue now, but feel free to reach out if you need further assistance. Thank you for your patience and understanding!

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.