XPath to CSS selector

Xpath expression
CSS Selector

ThisXPath to CSSallows to convert XPath expressions to CSS selectors online. It is useful for those who know XPath but do not know CSS selector.

This converter does not manage all cases, you must consider the result of the conversion as a working basis, which allows you to give yourself an idea. The result should be corrected by you before using.

User guide

How to convert XPath to CSS Selector ?

  • Drag and dropyour file, or copy and paste your text into the editor above.
  • Your Xpath expression is automatically converted to CSS Selector.
  • Click on "Download CSS" button to download the result.
  • You can also copy the CSS Selector to the clipboard by clicking on the button "Copy to clipboard".

XPath to CSS

Web developers often need to use locators for their tests, under Selenium for example. For this, there are different selection languages, such as XPath and CSS selector.

XPath and CSS Selector are really handy for selecting elements in XML data. Sometimes it may be easier to use one instead of the other.

XPath exists since 1999 (2007 for the second version). While CSS has been around since 1996.

This converter is a beta version, it allows basic conversions, but does not manage all the selections possible with XPath.

This tool uses the "XPath to CSS" library.