How AI is applied across API Evangelist and APIs.io. Read my AI disclosure →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

lxml XPath in Python: Scraping Tutorial

calendar_today November 20, 2026 domain quanticdata-io

Parse the page with lxml.html.fromstring(r.content) and call doc.xpath() with an expression: //tag[@attr=”value”] to find, /@attr or /text() to read, contains() for classes and text, ancestor:: to climb. Every expression below ran on a real page, with its output and timing.

open_in_new Read original post