Selenium For Python: How To Dump Current Page's Html
Using the selenium module, how do I dump the current page's HTML (for debugging purposes)? It doesn't say how to here: http://selenium-python.readthedocs.io/api.html
Solution 1:
You can dump the current page's HTML content using the WebDriver
property page_source
.
Sample snippet:
from selenium import webdriver
driver = webdriver.Firefox()
driver.get('https://yourfavoriteurl')
if'interested_string'in driver.page_source:
print('String matched!')
Post a Comment for "Selenium For Python: How To Dump Current Page's Html"