utkarshkukreti / select.rs

A Rust library to extract useful data from HTML documents, suitable for web scraping.
MIT License
971 stars 69 forks source link

mutable borrow #32

Open ratijas opened 7 years ago

ratijas commented 7 years ago

seriously, there's no (sane) way to modify the content, once select::Document has been created.

what should i do if i need to tweak text of some elements before serializing it with Node::text()? i'm not quite interested in writing my own text() implementation…

utkarshkukreti commented 7 years ago

@ratijas sorry for replying so late. Yes, there is currently no easy way to modify the nodes. I do want this at some point but I don't know what the right internal representation of the nodes should be in order to support this, but I'm pretty sure it would require some major changes from the current representation, which stores a Vec and uses the index of the Node everywhere. If you've looked at the internals and have any suggestions, I'd be happy to hear them.