How to find links containing a specific word in case of insensitivity in selenium webdriver

I would like to find links containing: hello, Hello, hEllo, heLlo, etc. So far I use find_elements_by_partial_link_textone that is sensitive to checkout:

links = driver.find_elements_by_partial_link_text('hello')
+4
source share
1 answer

find_elements_by_partial_link_text(), as well as find_elements_by_link_text()case sensitive, and the behavior cannot be easily changed.

Instead, find the links along the xpath and apply the function lower-case():

links = driver.find_elements_by_xpath('//a[contains(lower-case(.), "hello")]')

See also:

+6
source

All Articles