Traceback (most recent call last):
File "/home/fredrik/InstaPy/5b4f8b23d69086001412c068.py", line 20, in
session.interact_user_followers(['alisanikushuna','vogue_ukraine','elle_ukraine','alina_frendiy'], amount=30, randomize=True)
File "/home/fredrik/InstaPy/instapy/instapy.py", line 1820, in interact_user_followers
self.logfolder)
File "/home/fredrik/InstaPy/instapy/unfollow_util.py", line 919, in get_given_user_followers
channel, logger, logfolder)
File "/home/fredrik/InstaPy/instapy/unfollow_util.py", line 658, in get_users_through_dialog
"//div[text()='Followers' or text()='Following']/following-sibling::div")
File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 393, 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 966, in find_element
'value': value})['value']
File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 320, 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":"//div[text()='Followers' or text()='Following']/following-sibling::div"}
(Session info: headless chrome=68.0.3440.106)
(Driver info: chromedriver=2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706),platform=Linux 4.15.0-33-generic x86_64)
@uluQulu some more errors ;)
I will PR the other two late today.
@jeffarese The above replacement that you've said, is not working. I tried both. It still shows the error to find the element.
ERROR [2018-08-25 13:27:38] [username] Sorry, an error occured: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//div[text()='Followers' or text()='Following']/following-sibling::div"}
This is the current scenario
The solution I pasted changes the selector.
So instead of "//div[text()='Followers' or text()='Following']/following-sibling::div"
, you would have "//div[text()='Followers' or text()='Following']"
.
It's not possible that you have the same error.
It's working for me right now.
@jeffarese which one is working?. Mine was already the //div[text()='Followers' or text()='Following']/following-sibling::div
then I changed it to //div[text()='Followers' or text()='Following']
still shows the same error
Now I changed back & It now shows- ERROR [2018-08-25 13:38:14] [username] Sorry, an error occured: Message: no such element: Unable to locate eleme
nt: {"method":"xpath","selector":"//div[text()='Followers' or text()='Following']/following-sibling::div"}
The second one is the one that works, //div[text()='Followers' or text()='Following']
.
If it shows some error, it's impossible that it's the same, because you are changing the selector that it said it was unable to locate.
Anyway. Thanks for the help. whatever the problem is InstaPy is not working right and showing the same thing.
to fix this error i create PR for it but for faster solve you should change in unfollow_util.py
"//div[text()='Followers' or text()='Following']/following-sibling::div")
to
"//div[text()='Followers' or text()='Following']")
Mehran, that's why I told him in my solution.
When i do this fix i still get this :
Traceback (most recent call last):
File "xxx.py", line 73, in job
session.interact_user_followers(competitors, amount=randint(140, 190), randomize=True)
File "C:\Users\testing\Documents\GitHub\InstaPy\instapy\instapy.py", line 1816, in interact_user_followers
self.logfolder)
File "C:\Users\testing\Documents\GitHub\InstaPy\instapy\unfollow_util.py", line 910, in get_given_user_followers
channel, logger, logfolder)
File "C:\Users\testing\Documents\GitHub\InstaPy\instapy\unfollow_util.py", line 729, in get_users_through_dialog
person_list = dialog_username_extractor(buttons)
File "C:\Users\testing\Documents\GitHub\InstaPy\instapy\unfollow_util.py", line 751, in dialog_username_extractor
if person and hasattr(person, 'text') and person.text:
File "C:\Program Files (x86)\Python37-32\lib\site-packages\selenium\webdriver\remote\webelement.py", line 76, in text
return self._execute(Command.GET_ELEMENT_TEXT)['value']
File "C:\Program Files (x86)\Python37-32\lib\site-packages\selenium\webdriver\remote\webelement.py", line 628, in _execute
return self._parent.execute(command, params)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 320, in execute
self.error_handler.check_response(response)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document
(Session info: headless chrome=68.0.3440.106)
(Driver info: chromedriver=2.41.578737 (49da6702b16031c40d63e5618de03a32ff6c197e),platform=Windows NT 10.0.17134 x86_64)
After if did your fix my unfollow_util.py
looks like this:-
# find dialog box
dialog = browser.find_element_by_xpath( "//div[text()='Followers' or text()='Following']")
@Mehran @jeffarese
When i run InstaPy it stills shows
ERROR [2018-08-25 15:01:02] [username] Sorry, an error occured: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//div[text()='Following']/following-sibling::div"}
You realise that's not possible right?
It's literally showing the selector you you had BEFORE the change.
It means that the file you are editing is no the one your script is using.
Maybe you have it installed in multiple places.
@forgottensword as your error said it still try to read old xPath method":"xpath","selector":"//div[text()='Following']/following-sibling::div
Are you sure you saved unfollow_util.py After Change ?
@Mehran yes I did. For a reassurance, the line no. for the code is 646-648, right?
@forgottensword Yes
@forgottensword Do you need to change the other occurrence too? Around line 390.
dialog = browser.find_element_by_xpath("//div[text()='Following']/following-sibling::div")
@Mehran I did what you said and im still getting error that its failing to get the desired amount
Hey @fgisslen
Page layout has been changed.
To solve, open up unfollow_util.py file,
1-) replace
dialog = browser.find_element_by_xpath(
"//div[text()='Followers' or text()='Following']/following-sibling::div")
with
dialog = browser.find_element_by_xpath(
"//div[text()='Followers' or text()='Following']/../../following-sibling::div")
2-) replace
dialog = browser.find_element_by_xpath(
"//div[text()='Following']/following-sibling::div")
with
dialog = browser.find_element_by_xpath(
"//div[text()='Following']/../../following-sibling::div")
Hey @jeffarese, nice touch but we need the reference to the dialog box under Following
or Followers
label rather than the reference to that Following
or Followers
element.
@uluQulu Which line is which though?
Could you guys please pull and double check if the fix works for everybody?
Thanks @uluQulu @timgrossmann InstaPy now works like a charm!
works perfectly.
@timgrossmann this fix isn't working for me,
INFO [2018-08-26 18:09:58] [nimrodhauzi] Session started!
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
INFO [2018-08-26 18:10:29] [nimrodhauzi] Logged in successfully!
.................................................................
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
INFO [2018-08-26 18:10:32] [nimrodhauzi] User 'adirbriga7' [1/1]
INFO [2018-08-26 18:10:51] [nimrodhauzi] Simulated follow : 1
INFO [2018-08-26 18:10:53] [nimrodhauzi] --> Followed b'lital.bilalov'
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
INFO [2018-08-26 18:10:58] [nimrodhauzi] Session ended - 2018-08-26
18:10:58
@uluQulu
Than you for the fix, however I am still getting issues with the code update. Can you please provide insight?
Traceback (most recent call last):
File "Umami.py", line 50, in
session.interact_user_followers(['uncorkplum', 'distilledliquorco', 'andrewhilton', 'catwalksalonspa', 'primhealthandbeauty', 'briosalonspa', 'lethcollege', 'lc_kodiaks', 'lethcampusmedia', 'ulethbridge', 'cityoflethbridge', 'lethbridge_wines', 'ulethlibrary', 'breadmilkandhoney', 'thehotwirepaninicafe', 'crazycakes.yql', 'typethreehomes'], amount=15, randomize=True)
File "/home/long/umami/instapy/instapy.py", line 1816, in interact_user_followers
self.logfolder)
File "/home/long/umami/instapy/unfollow_util.py", line 869, in get_given_user_followers
channel, logger, logfolder)
File "/home/long/umami/instapy/unfollow_util.py", line 614, in get_users_through_dialog
"//div[text()='Followers' or text()='Following']/following-sibling::div")
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":"//div[text()='Followers' or text()='Following']/following-sibling::div"}
(Session info: chrome=68.0.3440.106)
(Driver info: chromedriver=2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706),platform=Linux 4.15.0-32-generic x86_64)
Sorry guys realized this is the same issue @forgottensword was getting. Any comments on how to fix @forgottensword ??
after the changes @uluQulu mentioned, I get "Failed to load desired amount of users" error for all the users I list and program does not follow anyone.
edit: It is solved with the new update.
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
I am still getting this issue. How can I solve it?
im still having this issue
the same issue
Apparently this problem came back, because it started now in the morning for me
Most helpful comment
Hey @fgisslen
Page layout has been changed.
To solve, open up unfollow_util.py file,
1-) replace
with
2-) replace
with
Hey @jeffarese, nice touch but we need the reference to the dialog box under
Following
orFollowers
label rather than the reference to thatFollowing
orFollowers
element.Cheers 馃榿