Reputation: 2755
I have HTML like this
<img src="/image.png" value="-" alt="collapse">
I can get element like this:
driver.find_element_by_xpath('//img')
I see I can also get name by id
or class_name
.
But can I get an element by other names e.g. src
or value
?
I want to run a test only if value
is -
.
Upvotes: 2
Views: 425
Reputation: 111786
The following XPath will select all img
elements with a value
attribute equal to -
:
//img[@value='-']
Upvotes: 3