I'd like to be able to find links containing: hello, Hello, hEllo, heLlo, etc. So far I'm using find_elements_by_partial_link_text
which is casse sensitive:
links = driver.find_elements_by_partial_link_text('hello')
find_elements_by_partial_link_text()
as well as find_elements_by_link_text()
are both case sensitive and the behavior cannot be easily changed.
Instead, find links by xpath and apply lower-case()
function:
links = driver.find_elements_by_xpath('//a[contains(lower-case(.), "hello")]')
Also see:
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