How to convert this xpath to css?

css-selectors, selenium, selenium-rc, selenium-webdriver

Solution

Unfortunately, you can't.

The problem is that CSS selectors can't find by text. Therefore, you can't translate `text()='Continue'` XPath to a working CSS selector. This is one of the two main reasons for XPaths to be actually used till today for HTML elements selecting.

There was a `:contains()` pseudo class for this in CSS3, but it's long gone. Sizzle, the JS engine for CSS selecting in Selenium, has kept it, though. So if your browser doesn't support native CSS selecting (or you disable it), you can use it like this:

button.buttonLargeAlt:contains('Continue')[type='submit']

Problem

How to change this below Xpath to css? Please help. ``` //button[text()='Continue' and @class='buttonLargeAlt' and @type='submit'] ```

Original source