Apify

Apify and Crawlee Official Forum

b
F
A
J
A

How to use Playwright locator assertions in Crawlee?

In Selenium, we can check for element visibility by either using a WebDriverWait or just manually checking for the element, and in playwright this is done through expect assertions, while we can wait for an element using waitForSelector and using an appropriate timeout, i couldn't find a way to use expect location assertions inside the crawler.

Is there a way I can use them?

ref: https://playwright.dev/docs/api/class-page#page-get-by-title
A
H
3 comments
we can install the platywright/test package to get it working since crawlee is version agnostic for playwright but not sure if its recommended though
no sure if it is recommended but I have done it and it works really well
yeah those assertions are really clean to make sure what you are scraping is right and even the playwright docs recommend them. Thanks for the confirmation though!
Add a reply
Sign up and join the conversation on Discord
Join