Instapy: Devision by zero error

Created on 20 Feb 2018  路  18Comments  路  Source: timgrossmann/InstaPy

Hey, guys, this is the error it gives out since a few days. Can you give me a hand on fixing it?

Current Behavior

error

InstaPy configuration

session = InstaPy(username=insta_username, password=insta_password, headless_browser=False)
session.login()
session.unfollow_users(amount=500, onlyNotFollowMe=True, onlyInstapyMethod = 'FIFO', sleep_delay=60)
session.set_do_follow(enabled=True, percentage=90, times=1)
session.like_by_tags(['blogger', 'travelblog', 'travel', 'couple', 'destination', 'likeforfollow', 'like4follow', 'followme', 'follow4follow', 'instafollow', 'followback'], amount=50)
session.end()

wontfix

All 18 comments

@SkylimiTY
it can't find a link (0 links) to interact, and then cannot divide to zero cos it is math...
have a look at this post to find correct amount of links with new scroller

Thanks for the fix, it runs smoothly now

@uluQulu I updated my InstaPy folder from here again. I did what you proposed on your post, but now it just runs, spits a message and quits. The Error begging is TabError: ... How can I deal with this?

Hello @SkylimiTY
1. Use the latest version of the modifications
2. Make sure you have applied the changes correctly
3. Post the full traceback containing the error message and provide the thorough problem details
(some headlines: how did you get this error, after some update or came out unexpectedly? __and__ how consistent the problem is, facing it regularly or sometimes?)
we will solve it 馃挭

@uluQulu Well I used the ones you linked above in the comments. All changes applied correctly. I had to update the InstaPy directory to the current one and thats when the issue appeared. Right after it updated it gave me the same error listed above so I reimplemented your solution. I tried runnign the script but now it spits this error message listed above and exits. It doesn't even reach the logged in screen.

@SkylimiTY
Fine, I don't see it, did you post the traceback somewhere else?
It needs to be a wizard to propose a solution with the details you've mentioned : "TabError"
In that fix page there are some out-dated like_util.py files shared for some, do not use them, but apply as in my comment there manually with just 3 modifications, if you did it, please post traceback

My blind concern is that, while modifying, you've mixed _tabs_ & _spaces_ which python does not welcome, that's why check again modified lines so that you use either one of them in a file, but in that case it should opt out kinda _IndentationError_, though

@uluQulu I used this comment to make the changes. The problem is that when I run it it spits the error and closes very fast. How can I record the traceback?

great! @SkylimiTY it's most probably a syntax error, just post the full error you get in console output or share a screenshot of it

traceback is just a term used in Python to indicate syntax error in the code.

Here you go @uluQulu
traceback

@SkylimiTY my blind concern was true,... it is an indentation error that while modifying you've mixed tabs & spaces
Now check your file (like_util.py) to use either the tabs only for indentation or the spaces only...
And keep in mind that this is a general rule for python programming language as of today

_How to know_ you have used tabs or spaces? - _activate_ show hidden characters option in your _text editor_ to see tabs, spaces and other _invisible_ characters (_Atom, Notepad++ has that option I know of..._)

if you fail to do, attach your like_util.py, I will help

If you use pycharm it'll automatically change a tab to 4 spaces as per pep8

@uluQulu Here you go.. Sorry but I just couldn't find the extra indentation. Can you help out?
Much appreciated!
like_util.zip

unindent def get_links(browser, tag, logger, media, element): on line 601

@uluQulu @Tjorriemorrie Thank you very much! It works perfect now! Can you guys help me out with one more thing, I want to run it on a server but I don't know what to do. If you like show me a few topics I can read it would be great. I started learning coding just 2 weeks ago and I'm still new to it. Thank you in advance!

Now I have this:

traceback2

@SkylimiTY I have no any experience in running it on a server
1. _for the_ problem above, StaleElementReferenceException has happened to some before, it seems to be a new bug, can you try to update your Chrome (v65?) & chromedriver (v2.36?) to the latest stable versions and see if that error happens again
2. _also_ is that error consistent or happens sometimes?
3. _and_ did you use the latest version of the fix in #1365?

Congrats for starting the long enjoying journey of programming馃帄, we are in the same boat :-)
feel free to ask anything, I will help for topics I know of and use #python IRC channel in _freenode_ for mode advanced questions

Hey @SkylimiTY
The error you got above is just solved! Checkout the the updated gist (_read more_ here)

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

neomh picture neomh  路  3Comments

n0sw34r picture n0sw34r  路  3Comments

converge picture converge  路  3Comments

wyvers picture wyvers  路  3Comments

seuraltimez picture seuraltimez  路  3Comments