Playwright Knowledgebase

since playwright and jupyter are both using asyncio to run playwright in a notebook we must used the async client.

To take page screenshots in playwright we can use page.screenshot() method. Here's how to select areas and how to screenshot them in playwright.

To download files using Playwright we can either simulate the button click or extract the url and download it using HTTP. Here's how.

To persist playwright connection session between program runs we can save and load cookies to/from disk. Here's how.

To load local files as page URLs in Playwright we can use the file:// protocol. Here's how to do it.

To execute XPath selectors in playwright the page.locator() method can be used. Here's how.

To execute CSS selectors on current HTML data in Playwright the page.locator() method can be used. Here's how.

To wait for all content to load in playwright we can use several different options but page.wait_for_selector() is the most reliable one. Here's how to use it.

To capture background requests and response in Playwright we can use request/response interception feature through page.on() method. Here's how.

Blocking non-vital resources can drastically speed up Playwright. To do that page interception feature can be used. Here's how.

Related Blog Posts

How to Scrape Google Maps

We'll take a look at to find businesses through Google Maps search system and how to scrape their details using either Selenium, Playwright or ScrapFly's javascript rendering feature - all of that in Python.

How to Scrape Dynamic Websites Using Headless Web Browsers

Introduction to using web automation tools such as Puppeteer, Playwright, Selenium and ScrapFly to render dynamic websites for web scraping