universal_html icon indicating copy to clipboard operation
universal_html copied to clipboard

Add possibility to get a node attribute

Open ppcamp opened this issue 4 years ago • 0 comments

First of all, congrats to you! Your package is the only one that i've found that can handle with dumbs htmls inputs (broken ones).

Can you make the attributes of a Node being public? I mean, for now I'm using some regex approachs to got some attrs (like name/id/value).

// Current approach:
tree.getElementsByName('javax.faces.ViewState').first;
final jsfaces = Re.firstGroup(el.toString(), r'value=\s*"(.*)"');

// An interesting approach:
final jsfaces = tree.getElementsByName('javax.faces.ViewState').first.attributes['value'];

ppcamp avatar Sep 02 '21 02:09 ppcamp