from selenium import webdriver
browser = webdriver.Firefox()
browser.get(input('Enter URL: '))
html_source = browser.page_source
if 'whatever' in html_source:
    pass
Python Selenium, доступ к источнику HTML