I have an "onclick" element in a webpage whose HTML reads as follows:
<a href="#" onclick="fastener('3625')">Fastener</a>
I want to search this element using the string "fastener" or "Fastener" using Python + Selenium. The number "3625" will change depending on previous inputs, and hence cannot be searched for.
I tried the following, but in vain:
br.find_element_by_css_selector("a[@onlick*='fastener']").click()
Please suggest ways to do this. Thank you!
P.S.: I am using Python 2.7, with Chrome WebDriver and Chrome v62.
@onlickis an XPath syntax. In CSS you should usea[onlick*='fastener']