let results = expr.apply(&document)?;
let result = results[0];
let tag_node = match document.get_html_node(&result).unwrap() {
HtmlNode::Tag(tag_node) => Some(tag_node),
_ => None,
};
let some_attr = &tag_node.unwrap().attributes["attr_name"];
What do you think, maybe is a good to have some special method for this? Something like this:
// Return attributes if `HtmlNode` is `Tag` else `None`;
result.get_attributes(&document) -> Optional<HashMap<String, String>>
// Or create empty hashmap if not attributes
result.get_attributes(&document) -> HashMap<String, String>
Now for take access of attributes i write:
What do you think, maybe is a good to have some special method for this? Something like this:
I can create pr for this.