Instapy: Script login issue

Created on 3 Aug 2017  路  20Comments  路  Source: timgrossmann/InstaPy

Hello @timgrossmann,

After you lasted update the script excuted perfectly with the unfollow now working. I was able to test it with 10 at first, then I did 90, and they both worked perfectly.

After it was done with the 90, I attemted 500, but the script now reached the login screen was able to get the screen to change to the correct sign in screen (Login : password), but it would now not write the login and password to the corresponding field. Even after returning the values to 90, the script would not execute as befor. After about 10-30 sec, the command promt would show the following:

c:UsersjeffreyDocumentsGitHubInstaPy>py quickstart.py
Traceback (most recent call last):
File "quickstart.py", line 4, in
session.login()
File "c:UsersjeffreyDocumentsGitHubInstaPyinstapyinstapy.py", line 124, in login
if not login_user(self.browser, self.username, self.password):
File "c:UsersjeffreyDocumentsGitHubInstaPyinstapylogin_util.py", line 24, in login_user
action = ActionChains(browser).move_to_element(inputs[0]).click().send_keys(username)
IndexError: list index out of range

Kid regards,
Jeffrey

Most helpful comment

adding div solved the issue. thanks for your great effort

All 20 comments

Fixed on PR #457. Instagram changed div positioning.

@BernardoGO I checked the link you gave, but I couldn't quite decipher where the solution for my issue was on that page. Could you point out where the step by step solution is? So I can implement it here.

@BernardoGO I saw the Div part and saw the link, but being that I am new to python and not yet programming in it. Could you paste the exact code I need to enter.

So basically tim updated the scripts a few hours agao, and it worked perfectly, then a few hours later Instagram made that Div change you spoke of, so the situation is now current.

Could you take a look and the Tim update and the now updated Instagram login page to see what the change has to be?

Thank you in advance,
Jeffrey

@jeffreylm It is a pull request that changes different parts of the login procedure to fix this and other issues. There is no step by step solution since it will probably be merged to the master branch soon.

Meanwhile what you can do is download or clone the fork that implements the solution. https://github.com/BernardoGO/InstaPy

@BernardoGO does this copy you just send me have the fix Tim just made for the Unfollow bug?

Our paths crossed as you sent your message I was busy typing the one above.

@BernardoGO sidenote, I am so new to Github and Python, I don't yet understand the forking mechanism and merging with my local files and such. Just in the phase of getting my mind around how this all works. Been on Github for a few days now and Python for around the same amount of time.

So bear with me while I try to understand your explanations.

@BernardoGO Could you copy the piece of code from Tim's latest update that needs replacing with your version paste underneath? So I can just paste in place.

@jeffreylm I don't think it contains the unfollow update.
In this case you'll be better off replacing your instapy/login_util.py for the one in the link I've sent.

The login should work as expected

Ok, could you double check if Tim's latest update did any changes to that file? Then I know that I can just replace the file with no issue.

I've just checked it out again. His update changes the unfollow_util.py.

Let me know if it works out for you.

Thank you. Will let you know.

@BernardoGO It worked. It was able to login and do the unfollow as @timgrossmann updated to. I think Tim most probally will has to add this change immediately due to the fact that it will affect everyone at the moment.

Thank you for your effort

@BernardoGO has some good changes right there. If anyone is looking out for a quick fix then it just requires a minor change in the login_util.py
inputs = browser.find_elements_by_xpath("//form/div/input")
to
inputs = browser.find_elements_by_xpath("//form/div/div/input")

Relevant PR for this change: https://github.com/timgrossmann/InstaPy/pull/465/files

adding div solved the issue. thanks for your great effort

Replacing instapy/login_util.py by the one in #457 as pointed out by @BernardoGO fixes the issue.

Yes. #457 is the right and a permanent fix. I have closed #465

@BernardoGO Just a quick question, being new on the platfom. I started this thread, and being that it now seems to be solved, do I close the thread?

Not yet. It's only considered as fixed when it's merged to the master branch.

@BernardoGO Ok, that is clear.

457

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tibor picture tibor  路  3Comments

CodeMaster1 picture CodeMaster1  路  3Comments

harrypython picture harrypython  路  3Comments

converge picture converge  路  3Comments

neomh picture neomh  路  3Comments