I wrote a very simple program to find phrases in text. It works fine when I search for a class or ID. But I can't get it to find specific text. In this example, I want it to see if the website python.org has the word 'python' anywhere on the page.
Oddly it is returning 'python not found'. Appreciate your help with this!
from bs4 import BeautifulSoup
response = requests.get("https://www.python.org/")
soup = BeautifulSoup(response.text, "lxml")
find_python = soup.find_all(string="python")
if find_python:
print('found python')
else:
print("python not found")