scrapy-playwright is a free, open source data extraction & web scraping project written in Python and released under BSD-3-Clause. It has 1,458 GitHub stars, 163 forks and 22 open issues, and was last pushed 38 hours ago. On this registry it ranks #93 of 141 tracked projects in Data Extraction & Web Scraping, with 5 head-to-head comparisons available.

What is scrapy-playwright?

scrapy-playwright is a Scrapy download handler that performs requests using Playwright for Python, so existing Scrapy crawlers can render pages that require JavaScript โ€” built for Python developers who want browser-grade rendering inside a normal Scrapy workflow.

What it is

scrapy-playwright is a download handler plugin for Scrapy, the Python web-scraping framework. Instead of fetching pages through Scrapy's default HTTP machinery, it routes requests to Playwright for Python, Microsoft's browser automation library, which drives real browser engines. It lives in the Scrapy plugin ecosystem, is published under the scrapy-plugins GitHub organisation, is written in Python, and is released under the BSD-3-Clause licence. Distribution is through PyPI, with documentation hosted at scrapy-playwright.readthedocs.io.

The problem it solves is specific. Many modern pages deliver their content through JavaScript, so a plain Scrapy request returns an incomplete document that yields nothing useful to a spider's parsing code. The usual workaround is a separate browser automation script, which means abandoning Scrapy's scheduler, middlewares and item pipelines. scrapy-playwright replaces that split by substituting the download handler rather than the framework, so request scheduling and item processing continue as before.

Key capabilities

  • A Scrapy download handler that performs requests using Playwright for Python, replacing the default download path rather than the surrounding framework.
  • Renders pages that require JavaScript, so responses arrive at the parsing stage with client-side content already executed.
  • Adheres to the regular Scrapy workflow, explicitly without interfering with request scheduling or item processing.
  • Drives multiple headless browser engines; the topic list names chrome-headless, firefox-headless and webkit-headless.
  • Built for python-asyncio and python3, matching the asynchronous Playwright for Python API.
  • Published on PyPI with declared supported Python versions, and documented at scrapy-playwright.readthedocs.io.
  • Tested through GitHub Actions with coverage reported by Codecov, and licensed BSD-3-Clause.

Who uses it and how

  • Scrapy users who already have spiders, middlewares and item pipelines in place and need JavaScript-rendered pages without rewriting them as standalone Playwright scripts.
  • Teams scraping sites that serve content client-side, where Scrapy's default downloader returns a document that is missing the data they need.
  • Projects that must target more than one browser engine, since the topics cover Chrome, Firefox and WebKit in headless mode.
  • asyncio-based Python services and crawlers, given the python-asyncio and python3 topics and the asynchronous API it wraps.
  • Contributors around the scrapy-plugins organisation; the repository carries the hacktoberfest topic alongside 163 forks and 22 open issues, which points to an external contributor base.

Getting started

Install the package from PyPI as scrapy-playwright and enable it as the download handler in a Scrapy project; the setup steps are documented at scrapy-playwright.readthedocs.io.

How it compares

The facts name two adjacent tools: Scrapy itself and Playwright for Python. scrapy-playwright sits between them rather than competing with either, since it does not replace Scrapy's scheduling, middleware or item pipeline, and it does not replace Playwright's browser automation, which it delegates to. For anyone already running Scrapy, it is the integration layer that brings Playwright rendering into the existing framework instead of maintaining two separate stacks.

When to use it โ€” and when not to

A self-hoster takes on operating headless browser engines such as Chromium, Firefox or WebKit alongside the crawler, which is considerably heavier than plain HTTP fetching and is the main operational cost of this route. Projects that only need static HTML should stay with Scrapy's default downloader, where a browser adds nothing. The README excerpt is sparse โ€” largely badges and a short description โ€” so the substantive guidance lives in the Read the Docs site rather than on GitHub, and that documentation should be read before adoption.

project readme (upstream, from github) โ€” read inline

================= scrapy-playwright

.. image:: https://img.shields.io/pypi/v/scrapy-playwright.svg :target: https://pypi.python.org/pypi/scrapy-playwright :alt: PyPI version

.. image:: https://img.shields.io/pypi/pyversions/scrapy-playwright.svg :target: https://pypi.python.org/pypi/scrapy-playwright :alt: Supported Python versions

.. image:: https://github.com/scrapy-plugins/scrapy-playwright/actions/workflows/tests.yml/badge.svg :target: https://github.com/scrapy-plugins/scrapy-playwright/actions/workflows/tests.yml :alt: Automated tests

.. image:: https://codecov.io/gh/scrapy-plugins/scrapy-playwright/branch/master/graph/badge.svg :target: https://codecov.io/gh/scrapy-plugins/scrapy-playwright :alt: Coverage report

.. description starts

A Scrapy_ download handler that performs requests using Playwright for Python_. It can be used to handle pages that require JavaScript (among other things), while adhering to the regular Scrapy workflow (i.e. without interfering with request scheduling, item processing, etc).

.. _Playwright for Python: https://github.com/microsoft/playwright-python .. _Scrapy: https://scrapy.org/

.. description ends

Frequently asked questions

Is scrapy-playwright free to use?

scrapy-playwright is open source under the BSD-3-Clause licence. There is no licence fee and no seat count โ€” you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does scrapy-playwright do?

๐ŸŽญ Playwright integration for Scrapy

What is scrapy-playwright written in?

scrapy-playwright is primarily written in Python. Its source is publicly available at https://github.com/scrapy-plugins/scrapy-playwright, and it has 1,458 GitHub stars.