- Python Web Scraping Cookbook
- Michael Heydt
- 45字
- 2025-02-26 12:46:23
How it works
lxml converts the CSS selector you provide to XPath, and then performs that XPath expression against the underlying document. In essence, CSS selectors in lxml provide a shorthand to XPath, which makes finding nodes that fit certain patterns simpler than with XPath.