Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

树莓派3B运行失败 #117

Open
kid424 opened this issue May 25, 2021 · 1 comment
Open

树莓派3B运行失败 #117

kid424 opened this issue May 25, 2021 · 1 comment

Comments

@kid424
Copy link

kid424 commented May 25, 2021

系统版本,包含位数:Raspberry Pi OS 32Bit (基于Debian Buster)

python版本:3.7.3

软件/源码版本:commit 386a545

浏览器、驱动版本:官方源apt安装


详细描述

答:选择模式后因为Driver初始化失败报错。

全部报错

答:
Mydriver初始化失败

Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/common/service.py", line 76, in start
stdin=PIPE)
File "/usr/lib/python3.7/subprocess.py", line 775, in init
restore_signals, start_new_session)
File "/usr/lib/python3.7/subprocess.py", line 1522, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: './chrome/chromedriver.exe': './chrome/chromedriver.exe'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "pandalearning.py", line 74, in
driver_login = Mydriver(nohead=False)
File "/home/pi/Desktop/TechXueXi/SourcePackages/pdlearn/mydriver.py", line 80, in init
self.driver = self.webdriver.Chrome(executable_path="./chrome/chromedriver.exe",chrome_options=self.options)
File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/chrome/webdriver.py", line 73, in init
self.service.start()
File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/common/service.py", line 83, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'chromedriver.exe' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

建议

答:树莓派32位系统的chromedriver路径为/usr/lib/chromium-browser/chromedriver,希望能加入driver判断中。

@SnowRabbit-Kyo
Copy link

将File "\SourcePackages\pdlearn\mydriver.py", line 78后添加以下内容,补全树莓派Driver路径即可

        elif os.path.exists("/usr/lib/chromium-browser/chromedriver"):  # raspberry linux 包安装chromedriver
            self.driver = self.webdriver.Chrome(executable_path="/usr/lib/chromium-browser/chromedriver",
                                                chrome_options=self.option

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants