I'm looking for a HTML manipulation library for Rust. I want to be able to deserialize a HTML document, select nodes, modify them, and finally serialize it back.
I found html5ever, which I assume is more than capable of doing this, but it calls itself "browser-grade", which means "complicated". The documentation isn't of any help (from the perspective of someone who does not know everything there is to know about HTML5 and related standards, like me) and there is almost no examples (and definitely no examples that clearly explain what they are doing). Moreover, the part that (I think) has an API for what I'm trying to do (markup5ever_rcdom) is, in words of it's creators:
[...] built for the express purpose of writing automated tests for the
html5everandxml5evercrates. It is not intended to be a production-quality DOM implementation, and has not been fuzzed or tested against arbitrary, malicious, or nontrivial inputs. No maintenance or support for any such issues will be provided. If you use this DOM implementation in a production, user-facing system, you do so at your own risk.
Long story short, it seems like something not suited for my use case.
There isscraper, which I used before and liked, but it can't modify HTML, only read from it.
I also foundnipper. It looks like what I need, but it also looks like a dead project. I have nothing against a year of no updates for a library that hit the 1.0 mark already and is a finished, maintenance only product, but unstable (0.x) libraries that aren't actively developed are a sign of lost interest.
Maybe someone knows a good library that would satisfy my needs, or at least has a good resource on how to do what I want withhtml5ever, without using stuff I'm not supposed to be using.