I have a HTML snippet like this:
<span class="line S_line1">
评论
<em>1</em>
</span>
The thing is that number in <em>1</em>
is not predictable or sometime just omit, I want to find this element by
driver.find_element_by_link_text(u'评论*')
But it didn't work, is there a way to do that with a wildcard or regex?
driver.find_element_by_partial_link_text(u'评论')
You can using partial_link_text
.This way you can find a link with changing content using some part which is always constant.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With