lxml
High-performance XML and HTML processing library combining libxml2/libxslt with Python.
Scraping, browsers and parsing PyPI BSD-3-Clause
Used in agent projects
98
0.8% of 12,697 public repos built with AI coding agents
Rank in scraping, browsers and parsing
#3 of 16
by use in those projects
Downloads
88.4M
PyPI, last 7 days, lxml
GitHub stars
3,065
last push Oct 8, 2026
How lxml is used
lxml is a dependency in 98 of the 12,697 public GitHub projects set up for AI coding agents that we scanned (0.8%), #3 of 16 in scraping, browsers and parsing. The most used alternative there is Beautiful Soup. Projects that use it most often also use Beautiful Soup (72.4%), Requests (63.3%), python-dotenv (58.2%).
Often used with lxml
| Beautiful Soup | 72.4% of lxml projects · 57.5× more than average |
|---|---|
| Requests | 63.3% of lxml projects · 11.9× more than average |
| python-dotenv | 58.2% of lxml projects · 8.9× more than average |
| Pydantic | 54.1% of lxml projects · 10.6× more than average |
| NumPy | 45.9% of lxml projects · 12.0× more than average |
| aiohttp | 43.9% of lxml projects · 18.9× more than average |
| Pillow | 43.9% of lxml projects · 19.1× more than average |
| Uvicorn | 39.8% of lxml projects · 9.3× more than average |
By coding agent
| Claude Code | 1.2% of projects set up for it |
|---|---|
| GitHub Copilot | 1.3% of projects set up for it |
| Cursor | 1.0% of projects set up for it |
Share of public repos configured for each agent that list lxml as a dependency.
Install
| Package | pip install lxml |
|---|---|
| Main stacks | Python (93), Next.js (4), React Native / Expo (1) |
| Example projects | Josh-XT/AGiXT, manykarim/rf-mcp, XargonWan/Synthetic_Heart, impecablemee/gtm-mcp, bloXroute-Labs/solana-trader-client-python |
Alternatives to lxml
| Tool | Used in agent projects | Downloads / wk | GitHub stars | License |
|---|---|---|---|---|
| Beautiful Soup pypi Python HTML/XML parsing and screen-scraping library for web data extraction. |
160 (1.3%) | 69M | — | MIT License |
| Puppeteer npm Headless Chrome/Chromium automation for scraping, testing and screenshot generation. |
115 (0.9%) | 11.4M | 95.7K | Apache-2.0 |
| Cheerio npm jQuery-like syntax for parsing and manipulating HTML/XML with server-side speed. |
94 (0.7%) | 26.6M | 30.5K | MIT |
| Playwright (Python) pypi High-level Python API for automating browser testing and web scraping. |
68 (0.5%) | 26M | 15K | — |
| fast-xml-parser npm High-performance XML parser and builder without native dependencies. |
58 (0.5%) | 83.3M | 3,139 | MIT |
| csv-parse npm Parse CSV files using Node.js streaming Transform API for memory-efficient processing. |
51 (0.4%) | 20.6M | 4,280 | MIT |
| Playwright Core npm Headless browser automation library for cross-browser testing and web scraping. |
49 (0.4%) | 122M | 97.4K | Apache-2.0 |
| soupsieve pypi CSS selector implementation for BeautifulSoup to query HTML and XML documents. |
39 (0.3%) | 70.4M | 271 | — |