Python Sellenium Chromedrive - 无法设置路径(InstaPy)

时间:2017-09-12 03:04:04

标签: python selenium automation instagram selenium-chromedriver

我正在玩这个回购:

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

很抱歉这条长信息,我只是希望了解一切。我已经阅读了回购文件中的文档和问题,但我仍感到很困惑

1 个答案:

答案 0 :(得分:0)

尝试设置chrome驱动程序的路径

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