Python使用Phantomjs截屏网页

来源:互联网 发布:淘宝企业店铺开店装修 编辑:程序博客网 时间:2024/06/09 18:47
#!/usr/bin/python# -*- coding:utf8 -*-from selenium import webdriverimport osdriver1 = webdriver.PhantomJS(executable_path='/usr/local/bin/phantomjs')driver1.get("http://www.csdn.net")data = driver1.titledriver1.save_screenshot('csdn.png')print dataprint os.getcwd()