The script is not scrolling for me when it opens a tag to interact. Also, I get the 'Load button not found' message. I checked the class for load button in like_util.py and it has not changed. I had pulled and have the latest changes since yesterday.
does it happen in like_by_tags() function ? what parameters are you using ?
My quickstart.py file:
`from instapy import InstaPy
import os
session = InstaPy(username='xyz', password='xyz')
session.login()
session.set_do_comment(enabled=True, percentage=25)
session.set_comments(['Beautiful!', 'Great' ])
session.like_by_tags(['beach', 'sunset'], amount=40, media='Photo')
session.end()`
Script was working fine till couple of days back, started seeing this issue since yesterday.
It started working again now. Seems like it was a Chrome issue as I run from my local. Closing this issue.
I'm still having this issue with GUI
Here is what I observed. Chrome window scrolls and the script works normally on one of my lesser used accounts. However, for the account I frequently use and run the script on, the window has stopped scrolling. If I manually keep scrolling, it picks up the required number of posts and starts interacting with them. Not sure why this is happening. Again, I have not seen this behavior before and it started since few days back.
I ran the script from both command line and GUI and same issue. Also, I don't think system setting have anything to do with it as the script works normally on my secondary account.
Its not working for me neither. But, what helped, when "hashtag" page is loaded, just scroll manually down and load as much images as you can/want and its working. Its not a solution for autoload issue, it is just letting you use the app
Im trying to reproduce the problem, it's working fine here without errors using
session.like_by_tags(['roadbike'], amount=5)
can someone help to reproduce the error ?
I have a theory. Seems like it's an account specific issue. I don't know if it's possible or not, but looks like Instagram has disabled browser.execute_script("window.scrollTo(0, document.body.scrollHeight);")
piece of code for my account when I login from the browser. Again, I'm not sure how they can control the DOM for a user account, if at all it can be done. But that seems like the only explanation to me for now.
I am currently just manually scrolling and using the project. Not ideal, but a quick fix nonetheless.
@drogon34 can you try it using another account ?
@converge I have tried using another account and it scrolls fine. Only see this issue on my old account on which I run the bot daily.
Same issue here. Just tried with another accont and the scrolling works, as @drogon34 says. It's maybe a kind of protection that Instagram use against bots? Any ideas how to avoid it?
It's not a script problem, I tried some alternative scripts in order to avoid the use of window.scrollTo(0, document.body.scrollHeight);
and no one works. It's really really strange.
@daaanny90 Hope this is a temporary restriction. I've significantly reduced the use of the bot on my primary account and will report findings in a week or so. Also, I've not yet tested on firefox and may try that as well. In the meantime, if anyone figures out the cause/solution for this issue, please update here.
Just tried with firefox: same problem, scrolling doesn't work.
Function is defined in util.py but not used in like_util
๐
it looks like the "load more" button has been removed. now as you scroll down more pictures get loaded
I'm having the same issue, and I have not used the script since Sept 19. I just got the latest release and ran it, and it's also giving me the "load button not found" error. Managed to get 168 pictures loaded, but this is tag 1 of 5, and I like leaving it running while I sleep.
i confirm that's a user specific setting. I have multiple accounts and only on the one that I use instapy the button is missing. I managed a workaround by sending the end key a sufficient number of times but it only works if the window is on focus. I need to make it work even if it's not
can we fix it just scrolling down and not clicking at "load" button ?
certainly, the best option would be scrolling IF no load button is found.
can we fix it just scrolling down and not clicking at "load" button ?
i don't think it would make a good fix because it only works if the browser window is open. otherwise it doesn't scroll
The current workaround (scrolling manually) also requires the browser window to be focussed, but is less precise, as the script starts to use already loaded images automatically after a certain amount of time.
Due to the absence of a load button, the only way to load images is scrolling. Consequently, there is no way around the browser window being focussed anyway.
i think the scrip should search for the load button, if it can't be finded should try scroll down, if the scrolling down can see new post, should continue with the work adding posts to the core.
(i don't know how to programing on pyton)
Since the _Load more_ button is missing on some accounts and present on others, maybe we can have a conditional statement to check the presence of a load button once the user is signed in and navigates to the tag. If the _Load more_ button is not found on the page, we can initiate the scrolling sequence with something like:
window.scrollTo(0,document.body.scrollHeight); #scroll to absolute bottom of page
window.scrollTo(document.body.scrollHeight,0); #scroll to absolute top of page
We can run it in a sequence till the required number of posts have been gathered and then start interaction. I'll try implementing this over the weekend and see if it works. If anyone has any other suggestions let me know.
Hi @timgrossmann is there any plan to fix this?
It really kills the whole point of this, as it only pulls 12 images out of millions ๐ข
Manual scrolling does work, but obviously isn't the strategic solution.
PS- for me this is happening with all the functions(interact, like by tags)
@sunnypatel165 I will try to... Unfortunately I currently have close to no time at all to work on OS...
Maybe @converge can take a look at this... Also there is the issue with the unfollowings because the follow button is not checked right
Same issue here
Load button not found, working with current images!
I am pretty sure it's an Istagram semi-ban, I cannot even manually explore tags I used to use on bot, changing tags worked for me and script is working again. I hope instragram will unlock my banned tags soon.
Any solutions yet? just bumped into this problem
hey guys, this issue is happening just in specific accounts, if someone can provide me login/passwd for an account with this problem, I can try to fix it this weekend. (I'm at slack, link on README)
Same issue here....
I tried on several accounts and this is happening on all of them via my VPS
@converge i could provide you acc, this problem is so annoying
Got the same issue. On my end, Instagram has removed the "Load More" button altogether, replacing it with instant Infinite Scroll. So I don't think it's a ban or anything, just a change in behavior and the Instagram team probably testing a UI change (as they usually do over at Facebook โ targeting specific user accounts or geographic locations before deciding to implement it or not across the entire platform).
@converge, @timgrossmann Maybe the script needs to adapt? If there's no Load More button, scroll down NumPhotosForTag/12 (or something like that โ seeing as Instagram seems to load 12 photos by default, so say 100/12 = 8,3, scroll down eight times to get ~100 photos) to load the approximate number of photos desired?
Tested it quickly, and got it working roughly with the following (for tags + amount):
for i in range(int(math.ceil(amount/12))):
browser.execute_script(
"window.scrollTo(0, document.body.scrollHeight);")
sleep(2)
Used it in the 'except' block of the 'get_links_for_tag' function (probably not the perfect place to put it but I was just testing). I could work on a PR this weekend if what I'm saying makes sense (I'm not a python expert by any means too, keep in mind). Otherwise, I'll just leave this here. ๐
Edit: @drogon34 I didn't notice Instagram disabling window.scrollTo on my end. Just the fact that it couldn't find a Load More button, and then simply defaulted to using the 12 it had, seeing as the 'get_links_for_tag' function simply throws the error and then proceeds with its business. ๐
@MindRave Sounds very good, where did you put the Code? Could you share that file probably? :)
@Mattes85 I will try to help you out think Mind is busy, correct me if I m wrong. Instapy -> instapy -> like_util open it up and find "get_link_for_tag" function.
@MindRave thanks for your solution
@Mattes85 insert it in line 167 in like_util.py
i had to adapt it a bit (-math & indent sleep):
# print('Load button not found, working with current images!')
for i in range(int(ceil(amount/12))):
browser.execute_script(
"window.scrollTo(0, document.body.scrollHeight);")
sleep(2)
@flo1t tried that didn't work
File "quickstart.py", line 1, in
from instapy import InstaPy
File "/root/InstaPy/instapy/__init__.py", line 1, in
from .instapy import InstaPy
File "/root/InstaPy/instapy/instapy.py", line 16, in
from .like_util import check_link
File "/root/InstaPy/instapy/like_util.py", line 168
for i in range(int(ceil(amount/12))):
@wizarduk the whole try, except, else expression has to look like this (at least in my case):
try:
load_button = body_elem.find_element_by_xpath(
'//a[contains(@class, "_1cr2e _epyes")]')
except:
# print('Load button not found, working with current images!')
for i in range(int(ceil(amount/12))):
browser.execute_script(
"window.scrollTo(0, document.body.scrollHeight);")
sleep(2)
else:
abort = False
....
I think he is catching IndentationError: unexpected indent, from copypasting the code incorrectly into the script
put in 167
load_button = body_elem.find_element_by_xpath(
'//a[contains(@class, "_1cr2e _epyes")]')
except:
# print('Load button not found, working with current images!')
for i in range(int(ceil(amount/12))):
browser.execute_script(
"window.scrollTo(0, document.body.scrollHeight);")
sleep(2)
else:
abort = False
....
still doesn't work
@flo1t works great thx!
@wizarduk did you have installed latest release? if not, do it so, and make the changes which @flo1t has provided
Cheers
Can someone just upload file :P?
here you are,
Exchange that file with your current file located on Instapy -> instapy
like_util.zip
Do not Forget to extract ;)
and overwrite that
Cheers
@wizarduk it works !!! tanks
@Mattes85 perfect works fine now
mine is saying its liking pictures but its not comments etc is working....
Its working thank you guys
@Mattes85 @flo1t Great work guys, how about a PR for this? :wink:
@timgrossmann @flo1t we should wait for a PR, i think the sleep time should be increased. It stocks after 20 maybe 30 loads, i just work with amount @500
will try with @sleep 5
@MindRave Great work ! Nice and clean fix and it's working smoothly.
The reason I thought is was a account specific restriction was because I tried with multiple accounts in the same geo location. I only saw this issue pop up on my primary acc that I regularly run the bot on.
But it could also be that they are rolling out new features and UI changes to older accounts first.
PR is on!
Thanks @MindRave @Mattes85 @flo1t and others!
just made a small adjust on @sunnypatel165 (great work!) PR.
Weird I updated code, but it still goes with load button
@dreamyUB Did you build the code again?
I made a new PR extending @sunnypatel165 idea. @dreamyUB you probably is using like by location, my PR should fix it. the main problem is, should we keep the load button click to load content ?
I closed my PR because I don't know if should we keep the button or not, my PR disregard the button.
PR: #862
im getting this error after a while @converge
File "/root/InstaPy/instapy/instapy.py", line 571, in like_by_tags
self.like_by_followers_lower_limit)
File "/root/InstaPy/instapy/like_util.py", line 352, in check_link
"return window._sharedData.entry_data.PostPage")
File "/usr/local/lib/python3.4/dist-packages/selenium/webdriver/remote/webdriver.py", line 465, in execute_script
'args': converted_args})['value']
File "/usr/local/lib/python3.4/dist-packages/selenium/webdriver/remote/webdriver.py", line 236, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.4/dist-packages/selenium/webdriver/remote/errorhandler.py", line 192, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Cannot read property 'entry_data' of undefined
(Session info: chrome=62.0.3202.62)
(Driver info: chromedriver=2.32.498513 (2c63aa53b2c658de596ed550eb5267ec5967b351),platform=Linux 2.6.32-042stab125.3 x86_64)
@wizarduk Do you have the latest version of InstaPy? (git pull
)
OK
Now just copy-paste on each "load button" in like_util and everything works properly.
Raspberry Pi 3
Would it be possible for everyone to write his country of residence here?
Just making sure that these "load button removes" are globally and not just some kind of A/B test
Thanks
No Problem, i am from germany
Currently in California, no load buttons here
Spain.
There aro no button on chrome on windowns, but if you use it with headless browser there was always the problem.
@timgrossmann i done this now im getting this error when i start ???
--> Image Liked!
Traceback (most recent call last):
File "quickstart.py", line 20, in
session.like_by_tags(['jokes', 'funny', 'lmao', 'jokes', 'lol' ,'laugh' ,'crazy','joking','silly','laughing','epic','lmfao','haha','humor','wacky','hilarious'], amount=60)
File "/root/InstaPy/instapy/instapy.py", line 587, in like_by_tags
self.browser, user_name, self.blacklist
File "/root/InstaPy/instapy/like_util.py", line 501, in like_image
add_user_to_blacklist(browser)
TypeError: add_user_to_blacklist() missing 3 required positional arguments: 'username', 'campaign', and 'action'
Brazil, no loads buttom.
New York, no load button on old acc but present on new account.
switzerland, no load buttons.
italy
no load button on instapy's account
load button present on old personal account
@timgrossmann i ended up starting again and reinstalling latest one and seems to be ok ....
India, no load button, that's why sent a PR :P
Serbia,
Checked on 3 accs there is no load button
@converge I was using like by location, you were right ^^
There is no interaction for a long time, please reopen it if you still need some help.
Most helpful comment
Got the same issue. On my end, Instagram has removed the "Load More" button altogether, replacing it with instant Infinite Scroll. So I don't think it's a ban or anything, just a change in behavior and the Instagram team probably testing a UI change (as they usually do over at Facebook โ targeting specific user accounts or geographic locations before deciding to implement it or not across the entire platform).
@converge, @timgrossmann Maybe the script needs to adapt? If there's no Load More button, scroll down NumPhotosForTag/12 (or something like that โ seeing as Instagram seems to load 12 photos by default, so say 100/12 = 8,3, scroll down eight times to get ~100 photos) to load the approximate number of photos desired?
Tested it quickly, and got it working roughly with the following (for tags + amount):
Used it in the 'except' block of the 'get_links_for_tag' function (probably not the perfect place to put it but I was just testing). I could work on a PR this weekend if what I'm saying makes sense (I'm not a python expert by any means too, keep in mind). Otherwise, I'll just leave this here. ๐
Edit: @drogon34 I didn't notice Instagram disabling window.scrollTo on my end. Just the fact that it couldn't find a Load More button, and then simply defaulted to using the 12 it had, seeing as the 'get_links_for_tag' function simply throws the error and then proceeds with its business. ๐