string_website.py
search string in webpage
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
browser = webdriver.Firefox()
browser.get("https://www.python.org/")
content=browser.page_source
result = content.find('integrate systems')
print ("Substring found at index:", result )
if (result != -1):
print("Webpage OK")
else: print("Webpage NOT OK")
#print(content)
browser.close()
run
python test_website.py
Substring found at index: 26722
Webpage OK
d:\tools>python test_website.py
Substring found at index: -1 ; -1 means nothing found
Webpage NOT OK