xpath_selector 3.0.2 copy "xpath_selector: ^3.0.2" to clipboard
xpath_selector: ^3.0.2 copied to clipboard

XPath package for HTML and XML, basic XPath syntax are supported.

xpath_selector #

Pub

An XPath selector for locating Html and Xml elements

English | 简体中文

Parser #

This library is for xpath selection only, you must define a parser, and here is my prebuilt parser:

If you want to use another parser, refer to these two libraries to define your own parser that implements the XPathNode<T> interface

Extended syntax #

In the attribute selector, the parser extends the following attribute selector in CSS style

Expression Css Description
[@attr='value'] [attr="value"] Selects all elements with attr="value"
[@attr~='value'] [attr~="value"] Selects all elements attribute containing the word "value"
[@attr^='value'] [attr^="value"] Selects all elements whose attr attribute value begins with "value"
[@attr$='value'] [attr$="value"] Selects all elements whose attr attribute value ends with "value"
[@attr*='value'] [attr*="value"] Selects all elements whose attr attribute value contains the substring "value"

Breaking changes #

1.x => 2.0 #

  1. Remove classXPathElement, which merge toXPathNode
  2. In XPathResult, elements=>nodes, elements=>element

2.0 => 3.0 #

  1. Remove the built-in html and xlm parsers, and make it independent to xpath_selector_html_parser and xpath_selector_xml_parser
9
likes
150
pub points
75%
popularity

Publisher

verified publisherz31.ink

XPath package for HTML and XML, basic XPath syntax are supported.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

expressions

More

Packages that depend on xpath_selector