How can I use selenium's find_elements_by_xpath()
based on text, when it may or may not have a word?
Example: it can be either #1 here
or #1 is here
. I want both to be part of the same list, since that func return a list. ATM I have driver.find_elements_by_xpath("//*[contains(text(), '#1 here')]")
but that would only find the first case, not the ones with an is
. Basically, something like driver.find_elements_by_xpath("//*[contains(text(), '#1 here' or '#1 is here')]")
How could I do that?
I'm also trying to keep their "order" So, first one from top to bot is #1 on list, etc
I could do 2 different lists, one for each and then combine them but that would also screw that up