首页 > Web开发 > 详细

Selenium+PhantomJS

时间:2017-01-12 11:56:05      阅读:301      评论:0      收藏:0      [点我收藏+]

from selenium import webdriver
import time
import os


path = os.path.dirname(__file__)
# print(path)
driver = webdriver.PhantomJS(executable_path=‘C:/Insert/phantomjs-2.1.1-windows/bin/phantomjs‘)
driver.get(‘http://pythonscraping.com/pages/javascript/ajaxDemo.html‘)
time.sleep(8)
print(driver.find_element_by_id(‘content‘).text)
driver.close()

问题 ‘Service‘ object has no attribute ‘process‘

其实就是你的浏览器可执行文件的路径没写对

Selenium+PhantomJS

原文:http://www.cnblogs.com/xiaochun365/p/6275302.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!