Selenium+PhantomJS

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'

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

posted @ 2017-01-11 21:36  有态度  阅读(211)  评论(0编辑  收藏  举报