Words to Number Converter
Turn "two hundred and forty-five" or "one lakh twenty thousand" back into digits.
Turn XPath into CSS selectors — and say plainly when CSS cannot express one.
Used for moving Selenium or Scrapy selectors to Playwright, Cypress or querySelectorAll.
The XPath to CSS Selector Converter translates expressions line by line — attributes, contains, starts-with, positions and last() — and says plainly when CSS cannot express one.
Old test suites are full of XPath. Newer tools — Playwright, Cypress, Testing Library, plain querySelectorAll — prefer CSS, which is shorter, faster in most engines, and far easier to read in a code review. Translating dozens of selectors by hand is dull and error-prone.
Paste a list of expressions, one per line, and get CSS. Attribute matches, contains(@class, …), starts-with(@href, …), position filters, last(), descendant and child steps, wildcards and namespace prefixes are all handled. Where CSS genuinely cannot express something — a parent axis, matching on text() — the line says so instead of producing a selector that quietly matches the wrong element, which is the worst thing a converter can do to a test suite.
Attribute equality, contains(), starts-with(), [n] and last().
[3] becomes :nth-of-type(3), not :nth-child(3).
A parent axis or text() match reports why, rather than guessing.
Paste a page-object file and convert every line together.
Each XPath next to its CSS, ready to copy one at a time.
One per line — a whole page-object file is fine.
Each line converts in place, with a table underneath.
The reason is written where the selector would be.
Ready for Playwright, Cypress or querySelectorAll.
CSS has no parent or ancestor axis and cannot match text content. //div/parent::section and //a[text()="Next"] have no CSS equivalent — Playwright’s :has() and text engines cover some of those cases.
XPath’s [3] counts the third matching element; CSS’s nth-child counts the third child whatever its tag. nth-of-type is the accurate translation.
Yes, when the value is a plain class name — which is what people mean by it. For other attributes it becomes the [attr*="x"] substring match, exactly as contains() does.
In browsers, usually — querySelectorAll is heavily optimised, while XPath evaluation is not. The bigger win is readability in review.
What people who use the XPath to CSS Selector Converter think of it. Reviews come from visitors and are posted as written.
No ratings yet
Yours would be the first.
0 reviews
Newest first
No reviews yet
Be the first to rate the XPath to CSS Selector Converter. It takes half a minute and no account.
Write the first reviewTurn "two hundred and forty-five" or "one lakh twenty thousand" back into digits.
Read an EPUB as plain text — chapter by chapter, in reading order.
Unserialize a PHP string into JSON — and back — with byte lengths handled and repairable.
SubRip subtitles as WebVTT, ready for the HTML5 video track element.
Open a Photoshop file without Photoshop and save it as PNG, JPEG or WebP.
Bhori, ana, roti, tola and grams — with carat purity and a price per bhori.
Pull the text out of a PDF — page by page, layout kept, nothing uploaded.
Any Tailwind CSS colour class as HEX — v3 and v4 — or the nearest class for a HEX.