Python

Articles from the Zyte blog in Python.

What is a self-healing web scraper?
AI-assisted data extraction

What is a self-healing web scraper?

A self-healing web scraper detects when a site change breaks extraction, repairs the code within limits you set, proves the fix with tests, and escalates when it can't. What it fixes, what it doesn't, how the loop works and what a repair costs.

John Rooney
self-healing-spider-agent
AI-assisted data extraction

Self-healing scrapers: four things to put in place before an AI agent fixes your spiders

What decides whether a self-healing scraper's repair is any good: detection during the crawl, a specific failure report, extraction code the agent can target, and tests that can fail.

John Rooney
A stream of web pages flowing from a globe through a gateway into a vector database
Data gathering for AI

Web Scraping for RAG: Build a Reliable Pipeline with Zyte API, Qdrant and LangChain

Build a RAG pipeline that survives bot blocks and JavaScript pages: fetch LLM-ready Markdown with Zyte API, gate bad pages, and test it before deploying.

Ayan Pahwa
A spider web inside a dashed loop, with one broken strand being mended by a glowing magenta thread
Tool-assisted coding

Self-healing spiders: letting an agent fix your Scrapy crawl, with a lid on it

Two demos from our Extract Summit Austin workshop: an agent repairs a Scrapy spider after a site redesign, then heals a live crawl mid-run through Spidermon and the Scrapy MCP, with the measured costs and the mistakes that shaped the design.

Ayan Pahwa
JSON Parsing with Python [Practical Guide]
Scraping practice

JSON Parsing with Python [Practical Guide]

Code for parsing JSON in Python, from json.loads on a string to json.load on a file. Includes fixes for the errors you'll hit and how to query nested data.

Felipe Boff Nunes20 min read
Inside Scrapy's RemoteControl extension
How To

Inside Scrapy's RemoteControl extension

Scrapy 2.19's RemoteControl extension runs a small authenticated HTTP server inside every crawl. How it starts, how it's secured, what the code you send can reach, and what you can do with it on a live crawl, plus the traps and what changes under scrapy-zyte-api.

John Rooney
One scrapy-playwright Spider, Three Browser Setups: Playwright, Patchright, and Zyte
How To

One scrapy-playwright Spider, Three Browser Setups: Playwright, Patchright, and Zyte

One Scrapy spider, three browser setups: stock Playwright, Patchright via the new PLAYWRIGHT_BROWSER_PROVIDER hook, and a remote browser on Zyte over CDP. Same spider and selectors throughout, only the browser changes.

John Rooney
scrapy-jev
Data quality

Stopping a crawl when the data stops looking real with Jev

A Scrapy pipeline that asks a fast, calibrated AI model whether each scraped field still looks real, and stops the crawl when too many don't. What it caught, what it misses, and whether building it was worth it.

John Rooney
Python lxml tutorial | Guide to Web Scraping with python lxml library
Scraping practice

How to scrape a website with Python and lxml

Install lxml, select elements with XPath and CSS selectors, and extract clean data from real pages. A practical Python web scraping tutorial with examples.

Felipe Boff Nunes14 min read
Zyte Blog — field notes from the world of data extraction
Learn Web Scraping

How to ensure data quality in your Scrapy web scraping projects using Spidermon and Claude Code

Spidermon is an open-source monitoring framework for Scrapy. You attach it to your spider, define what "success" looks like, and it automatically checks your crawl results after the spider closes, flagging anything that doesn't meet your standards.

Ayan Pahwa5 min read
The Scrapy whisperer: Adrian Chaves on Web Scraping Copilot
AI-assisted data extraction

The Scrapy whisperer: Adrian Chaves on Web Scraping Copilot

An interview with Scrapy maintainer Adrian Chaves on Zyte’s Web Scraping Copilot, AI-generated parsing code, and building reliable scraping workflows.

Neha Setia Nagpal10 min read
Zyte Blog — field notes from the world of data extraction
Developer interest

Stop using Python requests for web scraping: Use these modern modules instead

While the 'Requests' library remains the default choice for many Python developers due to its reliability and extensive documentation, the Python HTTP landscape has evolved considerably. Modern alternatives now offer significant advantages, including built-in asynchronous support, HTTP/2 compatibility, enhanced performance, and up-to-date TLS handling.

Ayan Pahwa6 min read