Skip to content

Repository files navigation

Browser puppetry: Playwright for dynamic website scraping

a.k.a. "Using Playwright to scrape pages that require you to fill out forms"

Dataharvest 2025, Mechelen

Jonathan Soma, Knight Chair in Data Journalism at Columbia Journalism School

Contact: jonathan.soma@gmail.com / @dangerscarf / jonathansoma.com

What is this?

Playwright is a next-generation browser automation tool that allows you to use Python or JavaScript to scrape almost any web page. It can assist in downloading pages of government documents, capturing tweets before they get deleted, or simply breaking past the cookie consent banner. Beyond the basics, it can also easily take screenshots, monitor and log network requests, and even fit right into your traditional BeautifulSoup scraping approach.

Note for Windows: For some reason only one particular version of one particular thing works on Windows, so you need to run pip install ipykernel==6.28.0 before running Jupyter. The explanation is long and complicated. Also, maybe doing that breaks some things? It honestly isn't clear.

The examples

Slides are here

More links

If you'd like a general-purpose introduction to Playwright try this one, and if you want to know how to break CAPTCHAs, here you go!

The Playwright documentation is also pretty good.

About

Notes for Browser Puppetry at Dataharvest 2025

Resources

Stars

4 stars

Watchers

1 watching

Forks

Packages

Contributors

Languages