Guides
One guide per capability, each with runnable examples. Start with Core concepts if you're new, or jump straight to the task you need.
Core concepts
- Core concepts: the tab and browser objects, the async model, and what "no webdriver" means in practice.
Finding and extracting
- Element finding: locate elements with
find()(by attributes) andquery()(CSS or XPath). - DOM traversal: move from an element to its children, siblings, and shadow roots.
- Structured extraction: pull typed, validated data from a page with a model.
Interacting
- Keyboard: type text and press keys, with humanized timing.
- Mouse: click elements or drive raw coordinates, with humanized movement.
- File operations: upload files and handle downloads.
- Iframes: find and drive elements inside frames.
- Screenshots and PDFs: capture the page, an element, or a PDF.
Network
- Network monitoring: watch requests and responses as they happen.
- Request interception: block, modify, or mock requests.
- Browser-context HTTP requests: call APIs from the browser session, with its cookies and auth.
- HAR recording: record a session to a HAR file.
Managing the browser
- Tabs: open, close, and drive several tabs at once.
- Browser contexts: isolated sessions in one browser, each with its own cookies.
- Cookies and sessions: read, set, and persist cookies across runs.
- Browser options: command-line flags, headless, and the launch configuration.
- Browser preferences: Chromium's internal preference dict.
- Proxies: route traffic through a proxy, with authentication.
- Remote connections: attach to an already-running browser.
Reacting to events
- Events: run callbacks when page and network events fire.
- Retrying: retry flaky steps with the
retrydecorator.
What's next
- Staying undetected: humanized behavior, captcha handling, and fingerprinting.
- API Reference: every public class and method.