Hi ,
When i execute script below , i'm getting error .
Script :
from instapy import InstaPy
session = InstaPy(username='*', password='**', nogui=True)
session.login()
session.set_sleep_reduce(95)
session.follow_user_followers(['vmilor','dontyoueatcom', 'aslangurme','bizevdeyokuz','beingurmetr','damakcatlatan','ayhansicimoglu','teomanhunal','cuneytasan'], amount=20, random=False, sleep_delay=60)
Error - Log :
Logged in successfully!
Traceback (most recent call last):
File "FollowDontYouEatFollowers.py", line 11, in
session.follow_user_followers(['vmilor','dontyoueatcom', 'aslangurme','bizevdeyokuz','beingurmetr','damakcatlatan','ayhansicimoglu','teomanhunal','cuneytasan'], amount=20, random=False, sleep_delay=60)
File "/root/InstaPy/instapy/instapy.py", line 910, in follow_user_followers
userFollowed += follow_given_user_followers(self.browser, user, amount, self.dont_include, self.username, self.follow_restrict, random, sleep_delay)
File "/root/InstaPy/instapy/unfollow_util.py", line 380, in follow_given_user_followers
personFollowed = follow_through_dialog(browser, user_name, amount, dont_include, login, follow_restrict, allfollowing, random, delay, callbacks=[])
File "/root/InstaPy/instapy/unfollow_util.py", line 189, in follow_through_dialog
dialog = browser.find_element_by_xpath('/html/body/div[4]/div/div[2]/div/div[2]/div/div[2]')
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 293, in find_element_by_xpath
return self.find_element(by=By.XPATH, value=xpath)
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 752, in find_element
'value': value})['value']
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 236, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/errorhandler.py", line 192, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/div[4]/div/div[2]/div/div[2]/div/div[2]"}
(Session info: chrome=60.0.3112.101)
(Driver info: chromedriver=2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5),platform=Linux 4.4.0-96-generic x86_64)
Try this @ihsaannn
Change line ~110 in "instapy > unfollow_util.py" to:
# find dialog box dialog = browser.find_element_by_xpath('/html/body/div[4]/div/div/div[2]/div/div[2]')
Thanks @cagalindo your fix does work!
Thanks. Helped a lot.
There is no interaction for a long time, please reopen it if you still need some help.
Hi,
I changed in "instapy > unfollow_util.py"
the line :
# find dialog box dialog =
browser.find_element_by_xpath("//div[text()='Following']/following-sibling::div")
By
# find dialog box dialog = browser.find_element_by_xpath('/html/body/div[4]/div/div/div[2]/div/div[2]')
But i still have :
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/div[4]/div/div/div[2]/div/div[2]"}
any idea?
Regards
My bad, i didnt change the line ~110 in "instapy > unfollow_util.py" to:
I did it after relecture, but still not working and said :
SyntaxError: invalid syntax
Sorry i'm not a dev boy :o
Thanks for all ya work
Regards