Get tag name with kuchiki (html5ever)


Hello, I parse html page with kuchiki crate and I need to get node name as a string. For example, I have NodeRef and I call next_sibling on it. Now I want to know what tag is it. I found that it’s possible with element.as_element().name.
This returns something like:

QualName { ns: Atom(‘’ type=static), local: Atom(‘br’ type=static) }

This is structure from html5ever
local field is something like cache engine from servo. How can I directly extract that br from it?


Ok, after a few experiments and with a great help of rust compiler I found that there is methods like to_lower, to_upper, encode_default, etc. All of them return string representation of tag name.