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.

User avatar

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

Open

GC7 (GC7) opened this issue
22 days 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.

User avatar

GC7 (GC7)

22 days ago

Note that this code:

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

works, waiting your answer...

User avatar

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

Developer
Maintained by Apify
Actor metrics
  • 36 monthly users
  • 98.0% runs succeeded
  • 8.6 days response time
  • Created in Sep 2023
  • Modified 22 days ago