Python使用Phantomjs截屏网

2020-01-03 15:03:04 浏览数 (1)

代码语言:javascript复制
#!/usr/bin/python
# -*- coding:utf8 -*-


from selenium import webdriver
import os
driver1 = webdriver.PhantomJS(executable_path='/usr/local/bin/phantomjs')
driver1.get("http://www.csdn.net")
data = driver1.title
driver1.save_screenshot('csdn.png')
print data
print os.getcwd()

0 人点赞