XPath Tester & Generator
Click any element to get a reliable XPath and CSS selector, or type an XPath expression and see every match highlighted, in an HTML page or an XML document.
Safe by design
Scripts in pages you load or paste never run, and nothing is stored.
Fast, no sign-up
No account and no daily limit for normal use.
Built for developers
Made for scraping, testing, SEO checks and front-end work.
Find and test XPath for web scraping and testing
XPath is the query language scrapers, Selenium, Playwright and Scrapy use to point at elements in a page. Writing it by hand is slow and easy to get wrong, so this tool builds it for you: click an element in the preview and you get a short XPath based on its id or attributes when possible, the full path from the root, and a CSS selector.
To test an expression, type it into the XPath box. Every matching element is outlined in the preview, the number of matches is shown and the list underneath shows each match's tag and text, so you can see straight away whether your expression is too broad or too narrow.
The HTML is parsed by your own browser, exactly as Chrome or Firefox would build the page, so the results match what you see in the browser's developer tools. Scripts in the HTML are never run. Switch to XML mode for sitemaps, feeds, SOAP responses or Odoo views: matches are highlighted right in the source code, and the Tree tab shows the document like the Elements panel.
How to use it
- 1Paste HTML into the Source tab, open a file, or enter an address and press Load.
- 2Click any element in the preview or the Tree to get its XPath and CSS selector.
- 3Type your own XPath: the match count updates as you type, and Enter steps through the matches.
- 4Copy the selector you need with one click, or switch to XML / Odoo mode for XML documents.
What Our Users Say
Real feedback from people using WeblixTools, checked by our team before it appears.
Frequently Asked Questions
Which XPath version does the tester support?
XPath 1.0, the version built into every browser and used by Selenium, Playwright, Puppeteer, Scrapy and lxml. Functions such as contains(), starts-with(), text() and normalize-space() all work.
Why does my XPath work here but not in my scraper?
Browsers fix up HTML while parsing it, for example by adding tbody inside tables. If your scraper reads the raw HTML without a browser, remove tbody from the path or use a shorter, attribute-based XPath such as //table[@id='prices']//tr.
Is my HTML uploaded?
No. Pasted HTML is parsed and tested in your browser tab only. When you use Load from URL, our server fetches that page for you and sends its HTML back without storing it.
Does the page's JavaScript run?
No. Scripts are disabled in the preview for your safety, so content a page adds with JavaScript won't appear. Paste the HTML from your browser's Elements panel if you need that content.