我正在使用python ANA硒,自动执行某些过程,但想不出附硒默认铬轮廓 我试着用,硒铬连接默认的配置文件
capability = webdriver.DesiredCapabilities.CHROME
self.driver = webdriver.Remote('http://127.0.0.1:9515/wd/hib',capability)
当然
,我开始,chromedriver第一和也试过用,
import time
from selenium import webdriver
import selenium.webdriver.chrome.service as service
service = service.Service('./chromedriver')
service.start()
capabilities = {'chrome.binary': '/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome'}
driver = webdriver.Remote(service.service_url, capabilities)
driver.get('http://www.google.com/xhtml');
time.sleep(5) # Let the user actually see something!
driver.quit()
这个原因,selenium.common.exceptions.WebDriverException:消息:u'Could没有找到Chrome的二进制:
也试图用,
self.driver = webdriver.Chrome("./chromedriver")
这个工作,但不是默认的配置文件,也不知要知道,如何打开新窗口或新选项卡中使用呢?
谢谢。
那么chrome二进制文件是否存在:'/ Applications/Google \ Chrome.app/Contents/MacOS/Google \ Chrome'?这就是你所说的! – Arran 2013-03-07 15:55:45
感谢您的回复,根据这个,https://code.google.com/p/selenium/wiki/ChromeDriver是的,它在那里。 – user2136174 2013-03-07 16:53:16