Skip to content
pubscout

xpath_selector

3.0.2, released 4 years ago by z31.ink

XPath package for HTML and XML parsing with basic XPath syntax support.

WASM-ready
$ flutter pub add xpath_selector
Source repository

What it does

Provides an XPath selection mechanism for locating HTML and XML elements. It relies on separate parser implementations such as xpath_selector_html_parser or xpath_selector_xml_parser to process the underlying document structure.

AI-written summary of version 3.0.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to query HTML or XML documents using XPath expressions.
  • You want to combine standard XPath syntax with extended CSS-style attribute selectors.

Skip it when

  • You are looking for a complete, out-of-the-box HTML or XML parser package without installing separate parser dependencies.
  • You only need basic tree traversal without XPath expression capabilities.

Strengths

  • Supports basic XPath syntax and advanced CSS-style attribute selectors.
  • Decoupled from specific parsers, allowing custom node implementations.

Weaknesses

  • Requires additional parser packages (like xpath_selector_html_parser or xpath_selector_xml_parser) to parse documents.
  • Not all advanced XPath features are supported.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
1

Requires adding a compatible parser package like xpath_selector_html_parser or xpath_selector_xml_parser alongside this library.

// This library is for xpath selection only, you must define a parser like xpath_selector_html_parser or xpath_selector_xml_parser.

Alternatives

Packages that do the same job and could replace xpath_selector.

  • xml

    If you want built-in XML parsing and querying without needing a separate XPath selection wrapper.

Works with

Packages commonly used together with xpath_selector: ones it builds on, ones built on it, and its own family.