Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
never_inline
on March 28, 2025
|
parent
|
context
|
favorite
| on:
Xee: A Modern XPath and XSLT Engine in Rust
I have used it when using scraping some data from web pages using scrapy framework. It's reliable way to extract something from web pages compared to regex.
mdaniel
on March 29, 2025
[–]
don't overlook the ability to mix and match them, because each "axis" is good at its own things
response.xpath("//div[string-contains(@data-foo, "foo")").css(".some-class").re(r"[a-z][a-zA-Z]+")
The .css() flavor gets complied down into .xpath() but there is no contest about their expressivity:
https://github.com/scrapy/parsel/blob/v1.9.1/parsel/csstrans...
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: