我编写了一个 python 脚本,它在浏览器中执行一些任务(使用 Selenium),它在 Windows 中运行良好.现在我正试图把它放到我的树莓派上.
我进行了大量搜索以找到使其与 Chromium 一起使用的最佳方法.我能找到的最好的是这个 Reddit 链接.p>
问题是我找不到适合我的 Chromium 版本(版本 56.0.2924.84)的 chromedriver.当我进行 apt-get upgrade 时,它建议我拥有最新版本的 Chromium.我已经通过从这个 Launchpad Link 下载尝试了 chromedriver 版本 53 到 65.
所以当我运行以下命令时
从 selenium 导入 webdriverdriver_path = 'usr/lib/chromium-browser/chromedriver'驱动程序 = webdriver.Chrome(driver_path)Chrome 驱动程序出现此错误 > 58
selenium.common.exceptions.SessionNoteCreatedException: Message: session not创建的异常:Chrome 版本必须是 >= 59.0.3071.0(驱动信息:chromedriver=2.43,platform=Linux 4.9.35-v7+ armv7l)或者 chrome 驱动程序的这个错误 <58
selenium.common.exceptions.WebDriverException:消息:服务/usr/lib/chromium-browser/chromedriver 意外退出.状态码是:127如有任何帮助,我们将不胜感激
根据您的问题,您的 Chromium 二进制文件的版本为 56.0.2924.84.因此,考虑到这一限制,解决方案是从 ChromeDriver 版本nofollow noreferrer">ChromeDriver Google 存储
注意:几个月前,Chromium 团队做了一个 初步公告 ChromeDriver 的版本控制模型将发生变化.Chromium 团队 正在推进该计划.具体来说,ChromeDriver 2.46 将是最后一个带有 2 主要版本的版本.未来的 ChromeDriver 版本将带有类似于 Chrome 版本的版本号.我们将在下周发布 ChromeDriver 73,在 Chrome 73 Beta 版之前发布.
以下是新发布模型的工作方式:
当您使用 Raspberry Pi 时,您需要从 ChromeDriver 的 arm 格式github.com/electron/electron/releases/download/v1.6.0/chromedriver-v2.21-linux-armv7l.zip" rel="nofollow noreferrer">link 并在您的程序中使用它.
<小时>@Test.I have written a python script that does some tasks in the browser (using Selenium), which works fine in Windows. Now I am trying to now get it onto my Raspberry Pi.
I did a lot of searching to find the best way to get this to work with Chromium. The best I could find was at this Reddit Link.
The problem is that I cannot find a chromedriver that jives with my version of Chromium (version 56.0.2924.84). And when I do apt-get upgrade it advises me that I have the newest version of Chromium. I've tried chromedriver versions 53 through 65 by downloading from this Launchpad Link.
So when I run the following
from selenium import webdriver
driver_path = 'usr/lib/chromium-browser/chromedriver'
driver = webdriver.Chrome(driver_path)
I get this error for chrome drivers > 58
selenium.common.exceptions.SessionNoteCreatedException: Message: session not
created exception: Chrome version must be >= 59.0.3071.0
(Driver info: chromedriver=2.43,platform=Linux 4.9.35-v7+ armv7l)
or this error for chrome drivers < 58
selenium.common.exceptions.WebDriverException: Message:
Service /usr/lib/chromium-browser/chromedriver unexpectedly exited. Status code was: 127
any help here would be appreciated
As per your question your Chromium binary is of version 56.0.2924.84. So keeping this constraint in consideration the solution would be to download either of the following ChromeDriver version from ChromeDriver Google Storage
Note: A few months ago, Chromium Team made a preliminary announcement that ChromeDriver's versioning model will be changing. Chromium Team is moving forward with the plan. Specifically, ChromeDriver 2.46 will be the last release carrying the major version of 2. Future ChromeDriver releases will carry a version number similar to Chrome release. We will start with a release of ChromeDriver 73 next week, before the Beta release of Chrome 73.
Here is how the new release model will work:
As you are using Raspberry Pi you need to download the arm format of ChromeDriver from this link and use it within your program.
@Test.这篇关于WebDriverException:消息:使用 ChromeDriver 和 Selenium 在 Raspberry-Pi 上意外退出服务/usr/lib/chromium-browser/chromedriver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
如何制作一个在 Python 中提供角色的不和谐机器人How to make a discord bot that gives roles in Python?(如何制作一个在 Python 中提供角色的不和谐机器人?)
Discord 机器人没有响应命令Discord bot isn#39;t responding to commands(Discord 机器人没有响应命令)
你能得到“关于我"吗?Discord 机器人的功能?Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“关于我吗?Discord 机器人的功能?(不和谐.py))
message.channel.id Discord PYmessage.channel.id Discord PY(message.channel.id Discord PY)
如何在 heroku 上托管我的 discord.py 机器人?How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 机器人?)
discord.py - 自动更改角色颜色discord.py - Automaticaly Change an Role Color(discord.py - 自动更改角色颜色)