Example Code Runner (Playwright) avatar

Example Code Runner (Playwright)

Try for free

No credit card required

View all Actors
Example Code Runner (Playwright)

Example Code Runner (Playwright)

apify/example-code-runner-playwright
Try for free

No credit card required

Generic Actor to run code examples from the documentation via "Run on Apify" links.

Do you want to learn more about this Actor?

Get a demo
GC7 avatar

Need help for a part of the code in crawlee documentation.

Closed

GC7 (GC7) opened this issue
5 months ago

Hi,

Since yesterday, I'm learning apify's features.

Now : https://crawlee.dev/docs/introduction/scraping Part: Trying it out (Near 65% in the page...)

All the code works well, except: const priceElement = page .locator('span.price') .filter({ hasText: '$', }) .first();

Works well in apify console, but not locally... (Without this part, even locally all this script run well)

Is my package the same as apify console ? { "name": "my-actor", "version": "0.0.1", "type": "module", "description": "This is an example of learning Apify actor.", "dependencies": { "apify": "^3.2.0", "crawlee": "^3.9.2", "playwright": "^1.43.1", "puppeteer": "*" }, "devDependencies": { "@apify/eslint-config": "^0.4.0", "eslint": "^9.1.1" }, "scripts": { "start": "node src/main.js", "test": "echo "Error: oops, the actor has no tests yet, sad!" && exit 1" }, "author": "GC7", "license": "ISC" }

Thanks for your help.

Lionel.

GC7 avatar

GC7 (GC7)

5 months ago

Note that this code:

const price = (await page.locator('span.price').first().textContent()).split('$')[1];

works, waiting your answer...

paja avatar

Hi, thanks for reaching out, we´ll look into it and let you know what can be done.

janbuchar avatar

Hello, if you require help with running code samples locally, please reach out via Github discussions (https://github.com/apify/crawlee/discussions/) or join our Discord community (https://discord.com/invite/jyEM2PRvMU).

This issue tracker is for the actor responsible for running code examples only, which is why I'm closing this issue now.

Developer
Maintained by Apify
Actor metrics
  • 31 monthly users
  • 8 stars
  • 98.9% runs succeeded
  • Created in Sep 2023
  • Modified 3 months ago