I'm using the requests library in python to grab a webpage's text data, however this should only occur if a particular sentence is found, yet... it still does.
pageresult = requests.get(combo[0], headers=header).text
if "We're sorry, but the page you were looking for couldn't be found" or "Page not found" in pageresult:
print('on page\n')
print(combo[0])
text_file = open("PAGERESULT.txt", "w")
text_file.write(pageresult)
text_file.close()
For some reason this if
statement still executes, even though the conditions are not met.
Neither "We're sorry, but the page you were looking for couldn't be found" or "Page not found" are in the website text data, yet the statement still executes?