So I'm doing some web scraping in Rust, and so I will need to parse HTML. [scraper](https://docs.rs/scraper/latest/scraper/) (which uses [html5ever](https://github.com/servo/html5ever)) is doing fine except that it's the bottleneck of my application.<p>So I need a faster parser. I've tried [tl](https://docs.rs/tl/latest/tl/) which would've been perfect except that <i>it doesn't actually work</i> on the HTML I have. When I try to `query_selector` the elements I need, it returns nothing.<p>[Kuchiki](https://docs.rs/kuchiki/latest/kuchiki/) is abandonded.<p>I couldn't figure out how to get [lol-html](https://github.com/cloudflare/lol-html) to work for me (it's designed for <i>re-writing HTML</i>, whatever that means). It doesn't seem to have an API to extract the inner text of an element.<p>[html5gum](https://github.com/untitaker/html5gum) seems to be just an HTML tokenizer, or otherwise just too low-level. I <i>have not</i> yet tried [quick-xml](https://github.com/tafia/quick-xml/) but judging from the README, it's pretty low-level too. I mean, if these are the only options left then I will try them. Otherwise, I would love to use a parser that's faster but as ergonomic as `scraper` or `tl`.<p>At this point, I would be happy with an Lxml bridge/port of some sort. I don't need to mutate HTML, just parse and read data from it.
lxml is a wrapper around libxml2.<p>If you are after libxml2 performance, you can always make use of <a href="https://docs.rs/libxml/latest/libxml/" rel="nofollow">https://docs.rs/libxml/latest/libxml/</a>