I have a otherwise functioning piece of code, and this feels like a very simple question but I cant figure it out:
The piece of code below uses a list of HTML elements from web scraping and then prints the ones that contain 'THIS' in them. Works perfectly.
Now how do I get it to filter with 'or' for example to filter the ones with 'THIS' or 'THAT' or 'THOSE'?
Ive tried just replacing the 'THIS' with 'THIS' or 'THAT' or 'THOSE' but for some reason it starts to let through values even without 'THIS', 'THAT' or 'THOSE'.
Thanks for help!!
lst = [ x.text for x in span_elements ]
#THIS PIECE OF CODE
filtered_list = list(filter(lambda k: 'THIS' in k, lst))
print(filtered_list)