xpath_parse 1.0.2 copy "xpath_parse: ^1.0.2" to clipboard
xpath_parse: ^1.0.2 copied to clipboard

xpath package for dart, uses a path expression to select node or a list of nodes from an XML document.

xpath #

Pub support
XPath selector based on html.

Get started #

Add dependency #

dependencies:
  xpath_parse: lastVersion

Super simple to use #

final String html = '''
<html>
<div><a href='https://github.com'>github.com</a></div>
<div class="head">head</div>
<table><tr><td>1</td><td>2</td><td>3</td><td>4</td></tr></table>
<div class="end">end</div>
</html>
''';

XPath.source(html).query("//div/a/text()").list()

more simple refer to this

Syntax supported: #

Name Expression
immediate parent /
parent //
attribute [@key=value]
nth child tag[n]
attribute /@key
wildcard in tagname /*
function function()

Extended syntax supported: #

These XPath syntax are extended only in Xsoup (for convenience in extracting HTML, refer to Jsoup CSS Selector):

Name Expression Support
attribute value not equals [@key!=value] yes
attribute value start with [@key~=value] yes
attribute value end with [@key$=value] yes
attribute value contains [@key*=value] yes
attribute value match regex [@key~=value] yes
7
likes
30
pub points
23%
popularity

Publisher

unverified uploader

xpath package for dart, uses a path expression to select node or a list of nodes from an XML document.

Repository (GitHub)
View/report issues

License

Apache-2.0 (LICENSE)

Dependencies

flutter, html

More

Packages that depend on xpath_parse