Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98221

What is the best way to search case insensitive text using Selenium in Python?

$
0
0

The first column of row are email addresses. I send that value to a search bar and click search and then I wait until the search results come through. Then I have this following if statement to search if that email address popped up in the results.

But for the life of me, I can't figure out how to make the search case insensitive. So that if I send 'test@email.com' and it finds 'tEsT@EMAIL.com' it will return true.

if driver.find_elements_by_xpath("(//*[contains(text(), '" + row[1] + "')] | //*[@value='" + row[1] + "'])"):
    foundEmails += 1
    print("Found Email: " + row[1])

Viewing all articles
Browse latest Browse all 98221

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>