Playwright Knowledgebase

To click on modal popups like the infamous cookie conset alert we can either find and click the agree button or remove it entirely. Here's how.

To handle alert-type pop ups in Playwright the on "dialog" event can be captured and interacted with in both Python and NodeJS playwright clients

Learn how to scroll to the bottom of the page with Playwright using three distinct approaches for both Python and NodeJS clients.

To check whether an HTML element is present on the page using Playwright the page.locator() method can be used. Here's how.

Learn why the synchronous execution of Playwright is blocked on Jupyter notebooks and how to solve it using asyncio.

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

Provided by Scrapfly

This knowledgebase is provided by Scrapfly data APIs, check us out! 👇

Related Blog Posts

Playwright vs Selenium
Playwright vs Selenium

Explore the key differences between Playwright vs Selenium in terms of performance, web scraping, and automation testing for modern web applications.

What is a Headless Browser? Top 5 Headless Browser Tools
What is a Headless Browser? Top 5 Headless Browser Tools

Quick overview of new emerging tech of browser automation - what exactly are these tools and how are they used in web scraping?

How to Scrape With Headless Firefox
How to Scrape With Headless Firefox

Discover how to use headless Firefox with Selenium, Playwright, and Puppeteer for web scraping, including practical examples for each library.

Web Scraping Dynamic Websites With Scrapy Playwright
Web Scraping Dynamic Websites With Scrapy Playwright

Learn about Selenium Playwright. A Scrapy integration that allows web scraping dynamic web pages with Scrapy. We'll explain web scraping with Scrapy Playwright through an example project and how to use it for common scraping use cases, such as clicking elements, scrolling and waiting for elements.

How to Use Headless Browser Chrome Extensions for Web Scraping
How to Use Headless Browser Chrome Extensions for Web Scraping

In this article, we'll explore different useful Chrome extensions for web scraping. We'll also explain how to install Chrome extensions with various headless browser libraries, such as Selenium, Playwright and Puppeteer.

How to Scrape Google Maps
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
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