网页整页截图小工具

from selenium import webdriver
url = 'https://www.jijindou.com/'
driver = webdriver.PhantomJS(executable_path="E:\\python\\phantomjs-2.1.1-windows\\bin\\phantomjs.exe")
driver.get(url)
data = driver.title  #  <title>百度一下,你就知道</title>
driver.save_screenshot('{}.png'.format(data[:2]))
print(data[:2])

 

posted @ 2017-12-12 10:14  hbb360  阅读(375)  评论(0编辑  收藏  举报