路径不适用于chromedriver

时间:2017-09-29 17:57:19

标签: python selenium selenium-chromedriver

我尝试使用脚本InstaPy但是当我执行脚本时出现此错误:

selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

Exception AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.chrome.service.Service object at 0x106814d90>> ignored

我已将chromedriver放在路径/Users/myname/Downloads/chromedriver

我的代码是这样的:

from instapy import InstaPy
from selenium import webdriver
driver = webdriver.Chrome('/Users/myname/Downloads/chromedriver')

#if you don't provide arguments, the script will look for INSTA_USER and INSTA_PW in the environment

session = InstaPy(username='test', password='test')
session.login()

#Reduces the amount of time under sleep to a given percentage
#It might be useful to test the tool or to increase the time for slower connections (percentage > 100)
session.set_sleep_reduce(95)

#likes specified amount of posts for each hashtag in the array (the '#' is optional)
#in this case: 100 dog-posts and 100 cat-posts
session.like_by_tags(['#dog', 'cat'], amount=100)

session.end()

我像这样运行脚本:

python test.py

Python 2.7.10 硒== 2.53.6

您能帮忙解决此错误吗? 感谢

0 个答案:

没有答案