shakyShane/scraper — reverse-engineered prompt

Reverse engineered prompt

Build me a small Rust library for working with HTML, kind of like a simple scraper toolkit. I want to be able to feed it either a full HTML document or just a fragment, then query it with normal CSS style selectors like h1.foo, li, or attribute selectors. From the matched elements I should be able to get the tag name, read attributes, collect descendant text, and get either the outer HTML or inner HTML back as a string.

It should also support selecting inside another matched element, so I can grab a ul and then find its li children. If it makes sense, include basic DOM editing too, like removing selected nodes from their parent and then serializing the updated document.

Please make it feel browser grade and reliable with clean examples and tests that cover the main flows. A simple API is more important than lots of extras. If you need to, look up current Rust HTML parsing docs online and wire it up in a polished crate ready to publish.

Want more depth? Deep Reverse