Using "Follow from list" in the GUI, it follows first one or two users ok, then script stops with this error message:
selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document
(Session info: chrome=58.0.3029.110)
(Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.15063 x86_64)
@sweb1 This is probably not a problem with InstaPy itself, I'll leave this open, but also make sure to post this problem on the GUI Repo
Getting this issue as well
I'm getting this as well, after downloading that last update
@Nemixalone Could you look into that, please?
I should add, I'm using the command line program on a mac, not the GUI.
@doremidom Ahh good to know, thank you for the information! Well I'll look into it as well then...
Have you found the problem yet ? I'm using the GUI btw
Well, I seriously have no idea why this happens (mostly) with the GUI.
Couldn't get this error with the normal execution of the script and I'm not familiar enough with the GUI to solve his errors.
I can check that out but my GUI is doing nothing else than generating python lines to execute(maybe bad formatting after InstaPy updates), I mean it has nothing with the background working of InstaPy. But sure I can see whats up. @sweb1 @Mehnou Can you please open up quickstart.py file and copy whole line with something like this and paste it here please. Thanks
accs = ['therock','natgeo']
session.follow_by_list(accs, times=1)
I was able to fix this by removing sleep(10) at line 66, fyi
I removed it but it didn't work... It actually crashed sooner
I'm not using the GUI, so my fix only works for the command line program
Well I think it's actually the same, the GUI just writes the code in the quickstart.py and executes it
@timgrossmann Any luck? If alot of people are having this problem then it probably has something to do InstaPy itself
@Mehnou I'm running 4 accounts with this, never had that issue.
Could you please provide more informations about what system you are using, where you are located and so on...
I'm using Windows 7, python 2.7
@Mehnou Try python3 like mentioned several times now.
I'm having this problem using Windows 7 from command line (not gui) with python 3.
@jedbanger Could you try to find the post on which this happens, please?
Also post your quickstart file, please.
Sure tim (great proyect btw!)
This my quickstart file, just erasing/replacing any kind of sensitive info.
from instapy import InstaPy
import os
session = InstaPy(username= ****** pasword= *****)
session.login()
session.set_do_follow(enabled=True, percentage=25, times=1)
session.set_upper_follower_count(limit = 900)
session.set_lower_follower_count(limit = 50)
session.like_by_tags(['exampletag1', 'exampletag2'], amount=50, media='Photo')
array1 = ['lots', 'of different', 'usernames' ]
session.follow_by_list(array1, times=1)
session.unfollow_users(amount=30)
session.end()`
Tried modifying array1
to see whether if it was breaking when it encountered a private account, but i also saw the same error with public accounts.
@jedbanger Did you miss the comma between username and password?
Could you try to do it with the chaining example?
Like this:
InstaPy(username='', password="") \
.login()聽\
.set_do_follow(enabled=True....)
.
.
.
No, sorry, it was a typo when putting the **.
If i comment the .follow_by_list
i got no problems with the script. I can run any other feature. Its just that one that gives me trouble.
just tried it with the chaining example. Same problem.
@jedbanger Good to know the problem is with the .follow_by_list
Thank you this helps out a lot
@timgrossmann Nobody said it was only in following? My bad xD
@Mehnou Ahh ok, good to know.
@timgrossmann so what we should do to solve the problem ?? i have the same problem when i enter a list of user to fallow !!
@doremidom in which file you made changes ?
@timgrossmann Hey tim, downloaded it again, now it just crashes immediately when you give it a list to follow, without even running..
Anyone managed to solve this?
I have installed now latest Instapy version and run it from command line, still getting the error on first or second user (win 10, python 3.6).
@Nemixalone here is the quickstart.py content:
```python
accs = ['technik_tim','imtheonlycaptain','emilio.hasanov','serenacv96']
session.follow_by_list(accs, times=1)
I have installed now latest Instapy version and run it from command line, still getting the error on first running
Me too..
@sweb1 Well the formatting from GUI is fine as i can see,but i get this error on first account with command line.
--> technik_tim instagram account is opened...
Traceback (most recent call last):
File "quickstart.py", line 6, in <module>
session.follow_by_list(accs, times=1)
File "C:\Users\Nemanja\Desktop\InstaPy-master\instapy\instapy.py", line 261, i
n follow_by_list
followed += follow_given_user(self.browser, acc_to_follow, self.follow_restr
ict)
File "C:\Users\Nemanja\Desktop\InstaPy-master\instapy\unfollow_util.py", line
149, in follow_given_user
if follow_button.text == 'Follow':
File "C:\Users\Nemanja\AppData\Local\Programs\Python\Python36\lib\site-package
s\selenium\webdriver\remote\webelement.py", line 73, in text
return self._execute(Command.GET_ELEMENT_TEXT)['value']
File "C:\Users\Nemanja\AppData\Local\Programs\Python\Python36\lib\site-package
s\selenium\webdriver\remote\webelement.py", line 493, in _execute
return self._parent.execute(command, params)
File "C:\Users\Nemanja\AppData\Local\Programs\Python\Python36\lib\site-package
s\selenium\webdriver\remote\webdriver.py", line 252, in execute
self.error_handler.check_response(response)
File "C:\Users\Nemanja\AppData\Local\Programs\Python\Python36\lib\site-package
s\selenium\webdriver\remote\errorhandler.py", line 194, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.StaleElementReferenceException: Message: stale elemen
t reference: element is not attached to the page document
(Session info: chrome=59.0.3071.115)
(Driver info: chromedriver=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5b
a8),platform=Windows NT 6.1.7601 SP1 x86_64)
@Nemixalone yes i get this error from command line and I would be happy to get it work from command line. GUI is not my priority
@sweb1 @Mehnou Could you guys try to change the self.browser.implicitly_wait(25)
in the instapy.py file to more than 25 as it is right now and test again, please?
It's at line 103 in instapy/instapy.py
idk what y'all problem is but its working fine for me
I tried with settings 50,100,1000. First run I got passed first entry and stopped at second entry. Consecutive runs all stopped at first entry.
@snik123 which software config do you have? (o/s, chromedriver, python...)
@sweb1 I dont know how InstaPy is working (in background) I am here if GUI fucks up :smile:
@sweb1 windows 10 python 3.6.2 chromedriver 2.30.477700
from instapy import InstaPy
import os
session = InstaPy(username='#', password='#')
session.login()
session.unfollow_users(amount=10)
accs = ['nickelodeon', 'natgeo']
session.follow_by_list(accs, times=1)
session.end()
Mine started running fine after I turned off the follow by lists. Running GUI on Windows 10, Python 3.6. it's returning the same codes as above.
C:\InstaPy-master>quickstart.py
Logged in successfully!
--> rwnbyrawan instagram account is opened...
Traceback (most recent call last):
File "C:\InstaPy-master\quickstart.py", line 7, in
session.follow_by_list(accs, times=1)
File "C:\InstaPy-master\instapy\instapy.py", line 261, in follow_by_list
followed += follow_given_user(self.browser, acc_to_follow, self.follow_restrict)
File "C:\InstaPy-master\instapy\unfollow_util.py", line 149, in follow_given_user
if follow_button.text == 'Follow':
File "C:\Program Files\Python36\lib\site-packages\selenium\webdriver\remote\webelement.py", line 73, in text
return self._execute(Command.GET_ELEMENT_TEXT)['value']
File "C:\Program Files\Python36\lib\site-packages\selenium\webdriver\remote\webelement.py", line 493, in _execute
return self._parent.execute(command, params)
File "C:\Program Files\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 256, in execute
self.error_handler.check_response(response)
File "C:\Program Files\Python36\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 194, 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: chrome=59.0.3071.115)
(Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.15063 x86_64)
Quickstart below minus username/pass
from instapy import InstaPy
import os
session = InstaPy(username='###', password='###')
session.login()
session.set_do_follow(enabled=True, percentage=10, times=1)
session.like_by_tags(['denim', ' jeans', ' denimjacket', ' minimal', ' letsgosomewhere', ' pursuitpretty', 'whatiwore', ' strongcurves'], amount=50, media='Photo')
session.end()
for me the same issue as for @sweb1 , but when i delete the line with follow_by_list()
the bot is working!
running it with docker-compose on mac os
I can confirm that this is happening with private accounts. Any kind of solutions?
In my case Im getting this error with these following scenario:
@timgrossmann Is it fixed? I am still getting the same error.
it seems to be random. I ran it once and it crashed, ran it again with the same settings and it was fine. Maybe it depends on the actual site?
I had this problem on this script :
browser.click_link_by_id('loginButton')
# sleep(5)
for iframe in browser.find_by_tag('iframe'):
print(iframe['class'])
browser.quit()
That I solved by adding a print :
browser.click_link_by_id('loginButton')
# sleep(5)
for iframe in browser.find_by_tag('iframe'):
print(iframe['class'])
print()
browser.quit()
Seems to be a buffer issue ! It could be the reason on random raising.
Most helpful comment
I was able to fix this by removing sleep(10) at line 66, fyi