0

我最近安装了 InstaPy,并在互联网上下载了一个标准脚本。我知道开源代码没有任何问题,并且在论坛上说要下载 geckodriver。但是,我还没有找到合适的解决方案来安装 geckodriver,所以你们能告诉我解决这个问题的最佳方法吗?

错误:

>>> %Run basic_follow_unfollow_activity.py
InstaPy Version: 0.6.13
 ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._. 
Workspace in use: "/home/pi/InstaPy"
Error, unable to determine correct filename for 32bit linux
Traceback (most recent call last):
  File "/home/pi/Desktop/basic_follow_unfollow_activity.py", line 36, in <module>
    headless_browser=False)
  File "/home/pi/.local/lib/python3.7/site-packages/instapy/instapy.py", line 338, in __init__
    geckodriver_log_level,
  File "/home/pi/.local/lib/python3.7/site-packages/instapy/browser.py", line 122, in set_selenium_local_session
    driver_path = geckodriver_path or get_geckodriver()
  File "/home/pi/.local/lib/python3.7/site-packages/instapy/browser.py", line 38, in get_geckodriver
    sym_path = gdd.download_and_install()[1]
  File "/home/pi/.local/lib/python3.7/site-packages/webdriverdownloader/webdriverdownloader.py", line 177, in download_and_install
    show_progress_bar=show_progress_bar)
  File "/home/pi/.local/lib/python3.7/site-packages/webdriverdownloader/webdriverdownloader.py", line 129, in download
    download_url = self.get_download_url(version, os_name=os_name, bitness=bitness)
  File "/home/pi/.local/lib/python3.7/site-packages/webdriverdownloader/webdriverdownloader.py", line 324, in get_download_url
    raise RuntimeError(info_message)
RuntimeError: Error, unable to determine correct filename for 32bit linux

我尝试了以下解决方案:

  1. 论坛上的此链接安装 geckodriver - https://www.raspberrypi.org/forums/viewtopic.php?t=167292

  2. 在终端中安装了 firefox ESR -sudo apt-get install firefox-esr

4

2 回答 2

1

在我的 Pi 上运行 geckodriver 时我遇到了类似的问题。如果我没记错的话,ARM 支持有问题。我最终切换到 chromedriver。

您可以通过以下方式轻松安装它:
sudo apt install chromium-chromedriver

之后,您可以在没有任何可执行文件路径的情况下使用它,如下所示:

from selenium import webdriver

driver = webdriver.Chrome()
于 2021-08-12T04:57:03.303 回答
0

通过此链接在 instapy 文档中给出了安装 Geckodrive 的说明 - https://github.com/InstaPy/instapy-docs/blob/master/How_Tos/How_to_Raspberry.md

GeckoDriver 版本可以在以下位置找到:https ://github.com/mozilla/geckodriver/releases 。截至 2019-08-16 的最新 ARM 版本是 v0.23。

按着这些次序:

1) wget https://github.com/mozilla/geckodriver/releases/download/v0.23.0/geckodriver-v0.23.0-arm7hf.tar.gz
2) tar -xvzf geckodriver-v*
3) chmod +x geckodriver
4) sudo cp geckodriver /usr/local/bin/

确保 /usr/local/bin 在你的 shell PATH 中

安装 InstaPy

1) sudo apt-get install python3-pip
2) python3 -m pip install --user instapy
3) sudo reboot (optional)

完成 Firefox 安装

1) sudo pip3 install future
2) sudo apt-get install xvfb
3) sudo pip3 install pyvirtualdisplay
于 2021-08-12T13:04:35.540 回答