DrissionPage
Python based web automation tool. Powerful and elegant.
DrissionPage is a Python library that lets you mix browser automation and direct HTTP requests in one script, using its own browser communication layer instead of WebDriver for faster setup and no driver version matching.
DrissionPage is a Python library for automating web browsers and making HTTP requests, with the option to combine both in a single script. Most web automation tools force you to choose between controlling a real browser (useful for pages that load content with JavaScript) and sending direct HTTP requests (faster but limited to static content). DrissionPage lets you mix these two approaches, so you can send a quick request to fetch data, then switch to browser control to handle a page that needs interaction, all within the same code.
The library uses its own browser communication layer rather than WebDriver, which is the underlying standard most other Python browser automation tools rely on. According to the README, this means you do not need to download a matching driver for each browser version, and it runs faster. Other practical differences include the ability to search for elements across iframes without switching context, control multiple browser tabs at the same time without switching between them, save images directly from the browser cache, and take full-page screenshots that include content outside the visible area.
It supports Chromium-based browsers such as Chrome and Edge, as well as Electron apps. The library works on Windows, Linux, and Mac and requires Python 3.6 or higher. Configuration is stored in an ini file so you do not need to repeat setup code on every run, and the library can attach to an already-open browser session rather than always starting fresh, which helps during development.
The README is written in Chinese and points to an official documentation site for usage details and code examples. The license terms allow personal, non-commercial use and study, but prohibit commercial use without separate authorization from the author. The author also prohibits using the tool for scraping data that violates a site's robots rules or for activities that could harm others.
Where it fits
- Scrape JavaScript-heavy websites by mixing fast HTTP requests for static pages and browser automation for interactive sections in one script.
- Automate multi-tab browser workflows without switching context between tabs.
- Take full-page screenshots of web pages including content that extends beyond the visible viewport.
- Attach to an already-open browser session during development to avoid restarting the browser on every code change.