getElementsWithAttributes function
Selects elements from DOM with tag
and matches attribute.
tag
Type of tag for selection.
matchAttributes
Attributes to match in selection.
Implementation
List<Element> getElementsWithAttributes(
String tag, Map<String, dynamic> matchAttributes) {
var tags = (document.getElementsByTagName(tag)).whereType<Element>();
return tags
.where((e) => elementMatchesAttributes(e, matchAttributes))
.toList();
}