【问题标题】:Python Sellenium Chromedrive - can't set up the path (InstaPy)Python Sellenium Chromedrive - 无法设置路径(InstaPy)
【发布时间】:2017-09-12 03:04:04
【问题描述】:

我正在玩这个 repo:

https://github.com/timgrossmann/InstaPy

我已经克隆了 repo,安装了 Python 3.6、Selenium、py 虚拟驱动程序(虽然我不确定是否必须将它保存在某个地方)。

我有两个问题: 1) 如何为 PY 命令设置路径? ——这究竟是什么意思?它有什么作用?我已经用谷歌搜索过了,而且我没有任何 Python 经验,所以我很难理解它。 2) 我已经下载了 chromedriver 并将其放入资产中,但我无法确定我放在那里的内容是否有意义。

当我运行 chromedriver 时,我收到此错误:Only local connections are allowed. [0.011][SEVERE]: bind() returned an error, errno=48: Address already in use (48)。我试过杀了它,但它说没有什么可以杀的。

当我运行python quickstart.py 时,我收到此错误Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home,我假设这与我没有设置路径有关。

如果我运行python instapy/login_util.py,我会得到File "instapy/login_util.py", line 2, in <module> from .time_util import sleep ValueError: Attempted relative import in non-package

对不起,我的信息很长,我只是希望能理解一切。我已经阅读了 repo 中的文档和问题,但我仍然感到很困惑

【问题讨论】:

    标签: python selenium automation instagram selenium-chromedriver


    【解决方案1】:

    尝试设置chrome驱动的路径

    导入操作系统 os.environ["Selenium_Chrom_Path"] = "/foo/path_to_chrome_exec"

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-08-29
      • 1970-01-01
      • 2017-02-18
      • 2021-10-31
      • 1970-01-01
      • 2017-06-07
      • 2020-05-22
      相关资源
      最近更新 更多