#coding=utf-8
import selenium
import selenium.webdriver
import time
path = r"D:\Program Files\phantomjs-2.1.1-windows\bin\phantomjs.exe"
webdriver = selenium.webdriver.PhantomJS(path)
webdriver.get('https://baidu.com')
time.sleep(3)
webdriver.save_screenshot('baidu.jpg')
print(webdriver.page_source)
webdriver.quit()
网友评论