此代码引发异常:from selenium import webdriverimport timedriver = webdriver.Chrome()driver.get('https://www.google.com')time.sleep(10)这是回溯:Traceback(最近
此代码引发异常:
from selenium import webdriver
import time
driver = webdriver.Chrome()
driver.get('https://www.google.com')
time.sleep(10)
以下是回溯:
Traceback (most recent call last):
File "/home/orangepi/.local/lib/python3.10/site-packages/selenium/webdriver/common/selenium_manager.py", line 134, in run
completed_proc = subprocess.run(args, capture_output=True)
File "/usr/lib/python3.10/subprocess.py", line 503, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/lib/python3.10/subprocess.py", line 971, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.10/subprocess.py", line 1863, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/home/orangepi/.local/lib/python3.10/site-packages/selenium/webdriver/common/linux/selenium-manager'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/orangepi/.local/lib/python3.10/site-packages/selenium/webdriver/common/driver_finder.py", line 38, in get_path
path = SeleniumManager().driver_location(options) if path is None else path
File "/home/orangepi/.local/lib/python3.10/site-packages/selenium/webdriver/common/selenium_manager.py", line 103, in driver_location
output = self.run(args)
File "/home/orangepi/.local/lib/python3.10/site-packages/selenium/webdriver/common/selenium_manager.py", line 140, in run
raise WebDriverException(f"Unsuccessful command executed: {command}") from err
selenium.common.exceptions.WebDriverException: Message: Unsuccessful command executed: /home/orangepi/.local/lib/python3.10/site-packages/selenium/webdriver/common/linux/selenium-manager --browser chrome --output json
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/orangepi/Downloads/from selenium import webdriver.py", line 3, in <module>
driver = webdriver.Chrome()
File "/home/orangepi/.local/lib/python3.10/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__
super().__init__(
File "/home/orangepi/.local/lib/python3.10/site-packages/selenium/webdriver/chromium/webdriver.py", line 49, in __init__
self.service.path = DriverFinder.get_path(self.service, options)
File "/home/orangepi/.local/lib/python3.10/site-packages/selenium/webdriver/common/driver_finder.py", line 41, in get_path
raise NoSuchDriverException(msg) from err
selenium.common.exceptions.NoSuchDriverException: Message: Unable to obtain driver for chrome using Selenium Manager.; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location
我不知道我哪里做错了:chrome 已安装;我尝试了一些教程,但没有成功。