Skip to main content
DevTools24

Testador XPath

Teste expressões XPath contra documentos XML. Consulte, filtre e extraia dados com resultados ao vivo.

No results. Enter an XPath and click Evaluate.

XPath Quick Reference:

//tag - Select all matching tags

/root/child - Absolute path

[@attr='value'] - Filter by attribute

[position] - Select by position (1-indexed)

/text() - Get text content

/* - Select all children

XPath Tester - Detalhes Técnicos

XPath (XML Path Language) is used to navigate and select nodes in XML documents. It's essential for web scraping, XSLT transformations, and XML data processing. XPath expressions can select elements, attributes, and text nodes using path-like syntax.

Alternativa via Linha de Comando

# XPath in Python (lxml)\nfrom lxml import etree\ntree = etree.parse('file.xml')\nresults = tree.xpath('//book/title')\n\n# XPath in JavaScript\ndocument.evaluate('//div[@class]', document)