I am using Python with Beautiful Soup 4 to fetch some text from a website. I am using a for loop to say: "Print the text only if the returned text does not contain the word lorem"
My question is, how can I do the same but for multiple words? For example for lorem, ipsum and dolor.
This is what I have tried and I am unsure how to proceed:
for title in soup.select('.panel-heading h3 a'):
if 'lorem' not in title.text:
print(title.text, '-->', title.get('href'))