Definite's Extractor

My findings on Life, Linux, Open Source, and so on.

Tag Archives: span

[Selenium] Converting XPath locator with CSS.

According to selenium’s web site, CSS locator is not only powerful, but also fast.
But despite of that, I was hesitated and kept using xpath, mainly because I hadn’t had idea about how to search by innertext.

Until yesterday, I find that the pseudo class :contains() suit my need. Even better, it supports regex, yay!

But the main push is that XPath is incapable of dealing with certain tags, such as <span>, <label>.

So CSS, here I come!

Advertisements