【问题标题】:So i wanted to use splinter for web browser automation. and it is just not working所以我想使用 splinter 来实现网络浏览器自动化。它只是不工作
【发布时间】:2016-12-22 11:59:32
【问题描述】:

Splinter 文档指出:

所以我添加了路径。 ::

我的代码:

from splinter import Browser
executable_path = {'executable_path':'C:\Program Files (x86)\Google\Chrome\Application\chrome'}
browser = Browser('chrome', **executable_path)
browser.visit('https://google.com')

但是当我运行它时,我得到了这个错误:

"C:\Program Files\Python35\python.exe" C:/Users/vedan/PycharmProjects/erevna/erevna-splinter.py
Traceback (most recent call last):
File "C:/Users/vedan/PycharmProjects/erevna/erevna-splinter.py", line 4, in <module>
browser = Browser('chrome', **executable_path)
File "C:\Program Files\Python35\lib\site-packages\splinter\browser.py", line 63, in Browser
return driver(*args, **kwargs)
File "C:\Program Files\Python35\lib\site-packages\splinter\driver\webdriver\chrome.py", line 31, in __init__
self.driver = Chrome(chrome_options=options, **kwargs)
File "C:\Program Files\Python35\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 62, in __init__
self.service.start()
File "C:\Program Files\Python35\lib\site-packages\selenium\webdriver\common\service.py", line 96, in start
self.assert_process_still_running()
File "C:\Program Files\Python35\lib\site-packages\selenium\webdriver\common\service.py", line 109, in assert_process_still_running
% (self.path, return_code)
selenium.common.exceptions.WebDriverException: Message: Service C:\Program Files (x86)\Google\Chrome\Application\chrome unexpectedly exited. Status code was: 0
Process finished with exit code 1

我不知道该怎么办

【问题讨论】:

    标签: python google-chrome selenium splinter


    【解决方案1】:

    我在使用谷歌浏览器时遇到了同样的问题。就我而言,这是由于铬驱动程序版本而发生的。但这在更新后得到了解决。可能是chrome驱动程序和chrome之间的这个问题。也许它会对你有所帮助。您可以从这里下载最新版本: https://github.com/peterhudec/chromedriver_installer.git

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-05-14
      • 2020-12-01
      • 1970-01-01
      • 2013-08-23
      • 2012-02-27
      • 1970-01-01
      • 2016-01-27
      • 2021-06-20
      相关资源
      最近更新 更多