I'm using Python 2.7 with Selenium WebDriver.
My question is how to print whole page source with print method.
There is webdriver method page_source but it returns WebDriver and I don't know how to convert it to String or just print it in terminal
解决方案
.page_source on a webdriver instance is what you need:
>>> from selenium import webdriver
>>> driver = webdriver.Firefox()
>>> driver.get('http://google.com')
>>> print(driver.page_source)