I have a HTML tags:
<a href="rid=7059"> abc </a>
<a href="pid=8059"> fgh </a>
<a href="cid=9059"> cxq </a>
HOw do I check if a particular tag exists with the href attribute containing rid (First tag in the above example)
get_attribute() gets the value of a specified attribute but how do i check when in a page any such tag exists whose attribute value is rid ?
Thanks for the help.
You didn’t mention the language you are using, so from personal preference I’m assuming Python. Other languages shouldn’t really differ, though.
The
is_element_presentfunction can be used for this. From the Selenium source:For the locator you could use something along the lines of
"css=a[href*='rid']".