小编ern*_*rio的帖子

适用于 linux32 的 Chromedriver 不存在 - Python Selenium Chromedriver

我正在创建一个跨平台 python 脚本,它使用 selenium 执行一些命令。我有两个问题:

  1. 为什么以下脚本可以在 Windows 上运行,但不能在 Raspberry pi OS 32 位上运行?唯一有效的方法是删除 webdriver-manager,但这需要手动安装 webdriver。我用的是树莓派3
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.utils import ChromeType

options = Options()
options.headless = True
options.add_experimental_option("excludeSwitches", ["enable-logging"])
driver = webdriver.Chrome(service=Service(ChromeDriverManager(chrome_type=ChromeType.CHROMIUM).install()), options=options)
driver.get("http://www.google.com")
print(driver.title)
Run Code Online (Sandbox Code Playgroud)

输出是:

pi@raspberrypi:~/Documents/Software $ /bin/python /home/pi/Documents/Software/test.py


====== WebDriver manager ======
Current chromium version is 95.0.4638
Get LATEST chromedriver version for 95.0.4638 chromium
There is no [linux32] chromedriver for browser  in cache
Trying …
Run Code Online (Sandbox Code Playgroud)

python selenium selenium-chromedriver raspberry-pi selenium-webdriver

4
推荐指数
1
解决办法
4649
查看次数