It used to work but for one entire week this function (session.follow_user_followers) doesn't work properly. I tried to reinstall instapy, the chromedriver, changed parameter but.. doesn't work.
Chrome's window normally open the user, the follower of that user but it doesn't scroll neither pick any user of the list.
After 20sec the window closes itself end the session ended (skipping the rest of the code).
• This is the screen that instapy shot on the error:
• This is the error message on CMD:
Traceback (most recent call last):
File "E:\DATI\Soulless\Programmi\InstaPy-master\InstaPy-master\wsoulless_v3.py", line 42, in
randomize=True,
File "E:\DATI\Soulless\Programmi\InstaPy-master\InstaPy-master\instapy\instapy.py", line 3140, in follow_user_followers
self.logfolder)
File "E:\DATI\Soulless\Programmi\InstaPy-master\InstaPy-master\instapy\unfollow_util.py", line 1081, in get_given_user_followers
logger, logfolder)
File "E:\DATI\Soulless\Programmi\InstaPy-master\InstaPy-master\instapy\unfollow_util.py", line 809, in get_users_through_dialog
dialog = browser.find_element_by_xpath(dialog_address)
File "C:\Users\Soulless\AppData\Roaming\Python\Python37\site-packages\selenium\webdriver\remote\webdriver.py", line 394, in find_element_by_xpath
return self.find_element(by=By.XPATH, value=xpath)
File "C:\Users\Soulless\AppData\Roaming\Python\Python37\site-packages\selenium\webdriver\remote\webdriver.py", line 978, in find_element
'value': value})['value']
File "C:\Users\Soulless\AppData\Roaming\Python\Python37\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\Soulless\AppData\Roaming\Python\Python37\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//body/div[2]/div/div[2]"}
(Session info: chrome=73.0.3683.103)
(Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Windows NT 6.1.7600 x86_64)
• And this is the code used (I've censured mine nickname and credential):
Hope you find a way :(
Up :(
same for me!!
Same.
you solved?
if so how?
Same, not solved
I didn't solved yet, if someone find a way.. please share it :(
Looks like it's related to this line selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//body/div[2]/div/div[2]"}
. Instagram has probably changed it's markup.
Looks like it's related to this line
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//body/div[2]/div/div[2]"}
. Instagram has probably changed it's markup.
nothing to do than wait for an Instapy update?
Updating the xpath for the dialog worked for me. Sometimes it's the second div and other times it's the third div. So I used the role attribute to identify it.
Edit unfollow_util.py (line 809)
https://github.com/timgrossmann/InstaPy/blob/master/instapy/unfollow_util.py#L809
Old
dialog_address = "//body/div[3]/div/div[2]"
New
dialog_address = "//body/div[@role=\"presentation\"]/div/div[2]"
Updating the xpath for the dialog worked for me. Sometimes it's the second div and other times it's the third div. So I used the role attribute to identify it.
Edit unfollow_util.py (line 809)
https://github.com/timgrossmann/InstaPy/blob/master/instapy/unfollow_util.py#L809Old
dialog_address = "//body/div[3]/div/div[2]"
New
dialog_address = "//body/div[@role=\"presentation\"]/div/div[2]"
Works for me, thanks!
it seems to work for me as well, thank you very much!
Can't find the unfollow_util.py
Where is stored that file?
Can't find the unfollow_util.py
Where is stored that file?
The file is inside this folder: InstaPy-master/instapy
Can't find the unfollow_util.py
Where is stored that file?The file is inside this folder: InstaPy-master/instapy
:( found it, changed but.. still same error:
Can't find the unfollow_util.py
Where is stored that file?The file is inside this folder: InstaPy-master/instapy
:( found it, changed but.. still same error:
Strange, I just ran and it keeps running. Review the code again, if it does not work, update the chrome.
Can't find the unfollow_util.py
Where is stored that file?The file is inside this folder: InstaPy-master/instapy
:( found it, changed but.. still same error:
Strange, I just ran and it keeps running. Review the code again, if it does not work, update the chrome.
Deleted all InstaPy-master and recreated with the actual version.
Downloaded chromedrivers 2.46 from https://chromedriver.storage.googleapis.com/index.html?path=2.46/ and normally stored in the chromedriver folder inside python.
String on unfollow file changed as you said (check screen).
And reduced the code to only that action (check screen).
Same error...
Nevermind <3 It worked! I wrote that string in the wrong directory (I figure out that I have 2 same instapy directory one on %appdata% and another around my users' program).
Thank you anyway for the help :3
I'm still having the same problem. And my line 809 in the unfollow_util.py is not even close to what you guys are saying
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this problem still occurs, please open a new issue
Most helpful comment
Updating the xpath for the dialog worked for me. Sometimes it's the second div and other times it's the third div. So I used the role attribute to identify it.
Edit unfollow_util.py (line 809)
https://github.com/timgrossmann/InstaPy/blob/master/instapy/unfollow_util.py#L809
Old
dialog_address = "//body/div[3]/div/div[2]"
New
dialog_address = "//body/div[@role=\"presentation\"]/div/div[2]"