简体   繁体   English

Python webbot showstopper,由于 Chrome 驱动程序无法使用 webbot

[英]Python webbot showstopper, can not use webbot because of Chrome driver

Its been a long while since i have been on this platform so here goes.自从我上这个平台以来已经有很长时间了,所以这里。 I have just started using pythons webbot library.我刚刚开始使用 pythons webbot 库。 I think it is a pretty cool library from a developer stand point.从开发人员的角度来看,我认为这是一个非常酷的库。 It pretty much is way better than most for basic online automation tasks.对于基本的在线自动化任务,它几乎比大多数要好得多。 I have a problem that basically stops me from using it.我有一个基本上阻止我使用它的问题。 This is the code i have:这是我的代码:

from webbot import Browser

web = Browser()

print(web)

The error message is:错误信息是:

selenium.common.exceptions.SessionNotCreatedException: Message: session not created exception: Missing or invalid capabilities selenium.common.exceptions.SessionNotCreatedException:消息:会话未创建异常:缺少或无效的功能
(Driver info: chromedriver=2.39.562718 (9a2698cba08cf5a471a29d30c8b3e12becabb0e9),platform=Windows NT 10.0.19044 x86_64) (驱动程序信息:chromedriver=2.39.562718(9a2698cba08cf5a471a29d30c8b3e12becabb0e9),平台=Windows NT 10.0.19044 x86_64)

Now i have seen that there have been several answers to this type of question as i have copied and pasted the error message into a search engine and up popped a few answers some didn't go into enough detail and some just didn't plain work.现在我已经看到此类问题有几个答案,因为我已将错误消息复制并粘贴到搜索引擎中,并弹出了一些答案,有些答案不够详细,有些答案不够简单. I can use Selenium for what i need to do, but it seems to me that the webbot library is more streamlined and easier to use.我可以将 Selenium 用于我需要做的事情,但在我看来,webbot 库更精简且更易于使用。 Does anyone know how to fix this, and if the webbot dev team will be adding any other browsers to the webbot library.有谁知道如何解决这个问题,以及 webbot 开发团队是否会将任何其他浏览器添加到 webbot 库中。 Thank you for your time and effort to all who answer.感谢您为所有回答的人付出的时间和精力。

Given message means that it was unable to initiate browser session for 2 reasons:给定消息意味着它无法启动浏览器会话有两个原因:

  1. Whether driver version indeed is not suitable驱动版本是否确实不合适
  2. Webbot can't find Chrome binaries and error is just generic Webbot 找不到 Chrome 二进制文件,错误只是一般性的

I'm not sure what solutions you've already tried, but try to:我不确定您已经尝试过哪些解决方案,但请尝试:

1.Play with drivers from here (>= 76.xx) https://chromedriver.storage.googleapis.com/index.html 1.从这里玩驱动程序 (>= 76.xx) https://chromedriver.storage.googleapis.com/index.html

  1. Try to explicitly indicate driver location via Options尝试通过选项明确指示驱动程序位置
options = Options()
options.binary_location=r'home/localhome/seeking_code_mastery/driver'
web = webdriver.Chrome(options=options, executable_path='home/localhome/seeking_code_mastery/chrome.bin')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM