Instapy: Basic follow unfollow- Stops after it reaches first page/Times out

Created on 2 Apr 2019  路  13Comments  路  Source: timgrossmann/InstaPy


Expected Behavior

Current Behavior

Possible Solution (optional)

InstaPy configuration

wontfix

Most helpful comment

File: unfollow_util.py

change line 809
to

# find dialog box
dialog_address = "//body/div[3]/div/div[2]"
dialog = browser.find_element_by_xpath(dialog_address)

originaly
dialog_address = "//body/div[2]/div/div[2]"

All 13 comments

Same issue here. I think xpath has changed.

same

Traceback (most recent call last):
File "quickstart.py", line 52, in
randomize=False, interact=False)
File "/usr/local/lib/python3.6/dist-packages/instapy/instapy.py", line 3134, in follow_user_followers
self.logfolder)
File "/usr/local/lib/python3.6/dist-packages/instapy/unfollow_util.py", line 1082, in get_given_user_followers
logger, logfolder)
File "/usr/local/lib/python3.6/dist-packages/instapy/unfollow_util.py", line 810, in get_users_through_dialog
dialog = browser.find_element_by_xpath(dialog_address)
File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 394, in find_element_by_xpath
return self.find_element(by=By.XPATH, value=xpath)
File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 978, in find_element
'value': value})['value']
File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.6/dist-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: headless chrome=73.0.3683.86)
(Driver info: chromedriver=2.46.628388 (4a34a70827ac54148e092aafb70504c4ea7ae926),platform=Linux 4.15.0-46-generic x86_64)

File: unfollow_util.py

change line 809
to

# find dialog box
dialog_address = "//body/div[3]/div/div[2]"
dialog = browser.find_element_by_xpath(dialog_address)

originaly
dialog_address = "//body/div[2]/div/div[2]"

Works for me, Thanks

File: unfollow_util.py

change line 809
to

# find dialog box
dialog_address = "//body/div[3]/div/div[2]"
dialog = browser.find_element_by_xpath(dialog_address)

originaly
dialog_address = "//body/div[2]/div/div[2]"

thank you so much.

File: unfollow_util.py

change line 809
to

# find dialog box
dialog_address = "//body/div[3]/div/div[2]"
dialog = browser.find_element_by_xpath(dialog_address)

originaly
dialog_address = "//body/div[2]/div/div[2]"

I appreciate that BUT. Unfortunately I am new to this. I used the quick start template script. The script has 76 lines. I dont see where to change line 809. Sorry again Im a noob...

File: unfollow_util.py

change line 809
to

# find dialog box
dialog_address = "//body/div[3]/div/div[2]"
dialog = browser.find_element_by_xpath(dialog_address)

originaly
dialog_address = "//body/div[2]/div/div[2]"

I appreciate that BUT. Unfortunately I am new to this. I used the quick start template script. The script has 76 lines. I dont see where to change line 809. Sorry again Im a noob...

I appreciate that BUT. Unfortunately I am new to this. I used the quick start template script. The script has 76 lines. I dont see where to change line 809. Sorry again Im a noob...

You need to change the file named "unfollow_util.py" not your quickstart.py

Still no go. It gets to the first page of an account and shuts down. This is what it reads after the shutdown. Will that help
Traceback (most recent call last):
File "C:Users\rob\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\quickstart.py", line 50, in
randomize=False, interact=False)
File "C:Users\rob\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\instapy\instapy.py", line 3134, in follow_user_followers
self.logfolder)
File "C:Users\rob\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\instapy\unfollow_util.py", line 1082, in get_given_user_followers
logger, logfolder)
File "C:Users\rob\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\instapy\unfollow_util.py", line 810, in get_users_through_dialog
dialog = browser.find_element_by_xpath(dialog_address)
File "C:Users\rob\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\seleniumwebdriver\remotewebdriver.py", line 394, in find_element_by_xpath
return self.find_element(by=By.XPATH, value=xpath)
File "C:Users\rob\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\seleniumwebdriver\remotewebdriver.py", line 978, in find_element
'value': value})['value']
File "C:Users\rob\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\seleniumwebdriver\remotewebdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:Users\rob\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\seleniumwebdriver\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.86)
(Driver info: chromedriver=2.46.628402 (536cd7adbad73a3783fdc2cab92ab2ba7ec361e1),platform=Windows NT 10.0.17134 x86_64)

You got it wrong.

It's not : selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//body/div[2]/div/div[2]"}

It's dialog_address = "//body/div[3]/div/div[2]"

Read it up.

@Rzbck thanks mate.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

CharlesCCC picture CharlesCCC  路  3Comments

harrypython picture harrypython  路  3Comments

thisishotdog picture thisishotdog  路  3Comments

tibor picture tibor  路  3Comments

n0sw34r picture n0sw34r  路  3Comments