所以我想使用 splinter 来实现 Web 浏览器自动化。它只是不工作
So i wanted to use splinter for web browser automation. and it is just not working
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
我不知道该怎么办
我和 google chrome 有同样的问题。在我的例子中,这是由于铬驱动程序版本而发生的。但是更新后解决了这个问题。可能是 chrome 驱动程序和 chrome 之间的问题。也许它会对你有所帮助。您可以从这里下载最新版本:
https://github.com/peterhudec/chromedriver_installer.git
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
我不知道该怎么办
我和 google chrome 有同样的问题。在我的例子中,这是由于铬驱动程序版本而发生的。但是更新后解决了这个问题。可能是 chrome 驱动程序和 chrome 之间的问题。也许它会对你有所帮助。您可以从这里下载最新版本: https://github.com/peterhudec/chromedriver_installer.git