Pages

Topics

Tools

↑↓navigate↵openescclose

Python guides

Every published Python guide, newest first, with practical examples you can copy into your own project.

3,965 guides across 14 topics

Topics

Latest Python guides

Illustration of a Scrapy spider crawling between web pages with CSS and XPath selector brackets highlighting page elements.
Python

Python Scrapy: CSS, XPath, and Link Following

Learn how to select data with CSS and XPath in Scrapy and how to follow links with response.follow or CrawlSpider rules.

ScrapyWeb ScrapingCSS SelectorsXPath
A spider crawling a web page with request and response arrows and a selector extracting data.
Python

Python Scrapy Spider: Requests, Responses, and Selectors

Learn how Request, Response, and Selector objects work together in a Python Scrapy spider, from issuing requests to parsing pages with CSS and XPath.

ScrapyWeb ScrapingCSS SelectorsXPath
Comparison of Python Playwright and Selenium for browser automation, showing two browser windows with code snippets.
Python

Python Playwright vs Selenium: Which to Use?

Compare Python Playwright and Selenium for browser automation: installation, API design, selectors, waits, parallelism, browser support, and when to choose each.

PlaywrightSeleniumBrowser AutomationWeb Testing
Illustration of multiple browser pages being fetched concurrently by a Python Playwright async script
Python

How to Scrape Multiple Pages Concurrently with Python Playwright's Async API

Use Python Playwright's async API to scrape multiple pages concurrently. This article covers asyncio.gather, browser context isolation, concurrency limits, retries, and rate limiting.

PlaywrightAsyncWeb ScrapingConcurrency
A headless browser window connecting through a proxy server node to a target website, with a user agent tag, representing Playwright configuration in Python.
Python

Python Playwright Proxy, User Agent, and Headless Browser

Configure a Python Playwright browser with a proxy, custom user agent, and headless mode. Learn where each setting belongs, how to manage multiple proxy contexts, and how to debug common failures.

PlaywrightWeb ScrapingHeadless BrowserProxy Configuration
Illustration of a browser window with a network filter shield blocking unwanted requests while allowing essential traffic.
Python

Python Playwright Network Interception and Blocking Requests

python playwright network interception and blocking requests: Control network traffic in Python Playwright: intercept requests, block unwanted resources, and modify re...

PlaywrightPythonNetwork InterceptionRequest Blocking
Diagram showing a browser window with multiple tabs and an iframe panel, illustrating Python Playwright page and frame handling.
Python

Python Playwright: Iframes, Tabs, and Multiple Pages

Work with iframes, tabs, and multiple pages in Python Playwright using frame_locator, content_frame, expect_popup, expect_page, and context.pages.

Playwrightiframebrowser automationmulti-page
Illustration of a browser window with an upload arrow, a download arrow, and a camera icon representing Playwright's file upload, download, and screenshot capabilities.
Python

Python Playwright: File Upload, Download, and Screenshots

Learn how to automate file uploads, downloads, and screenshots in Python Playwright. Covers set_input_files, file chooser events, expect_download, and screenshot modes with code examples.

PlaywrightFile UploadFile DownloadScreenshots
Illustration of a browser session being saved to a file and reused in a new Playwright context, symbolizing login state persistence.
Python

Python Playwright: Save and Reuse Login Session

Learn how to save a Python Playwright login session with storage_state and reuse it in later runs to avoid repeated logins.

PlaywrightPythonAuthenticationBrowser Automation
Illustration of a browser context with cookie jar and authentication key, symbolizing session state management in Playwright.
Python

Python Playwright: Browser Context, Cookies, and Authentication

Understand how browser contexts isolate cookies and authentication state in Python Playwright. Save and restore sessions with storage_state, or inject cookies directly for reusable login flows.

Playwrightbrowser contextcookiesauthentication