deep-jade•2y ago
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-titlePage | Playwright
* extends: [EventEmitter]
3 Replies
deep-jadeOP•2y ago
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
deep-jadeOP•2y ago
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!