Essentially what I already have is a piece of code which finds all the selenium elements on a page which contain the keyword Matty Matheson Hood (see below):
keyword = 'Matty Matheson Hood'
list = driver.find_elements_by_xpath("//*[contains(text(), '" + keyword + "')]")
print(list)
Now this works fine, however, it returns 4 elements and I'm trying to narrow it down to 1 by getting rid of those which contain the keyword Tie Dye
Put simply I was wondering whether I could use something similar to what I have above, but instead use not contains, and is it possible to merge both contains and not contains into 1 search?
So find all elements (should only be 1) which contain Matty Matheson Hood but don't contain Tie Dye.
Any help is appreciated!
