Instapy: CRITICAL[...] Wrong login data!

Created on 26 Jul 2018  路  19Comments  路  Source: timgrossmann/InstaPy

First of all, I was getting some message like "issue with cookie for user." Then, I searched here and found out that I had to set " self.switch_language = False in instapy.py "
I did it and now I'm getting "Cookie file not found, creating cookie..." and finally "Wrong login data!"
I tried to delete my cookie file but it didn't solve the problem.
Also, I checked my username and password and I could log in manually on instagram using chrome.
Does anyone know how to solve it ? thx

Most helpful comment

This is a temporary fix, but this issue was bypassed by changing:
login_util.py line 116 from "https://www.instagram.com"

to

"https://www.instagram.com/accounts/login"

All 19 comments

Just to give an update if some1 gets this error.
I fixed it by updating my instapy to the newest repository.

I get this error to

Well, i updated my instapy but when i tried running today it is still not working.
i get this error
...
Cookie file not found, creating cookie...
CRITICAL [2018-08-07 19:12:56] [insta_username] Wrong login data!
...

Then, I watched my browser and saw that instapy is trying to login in the first page of instagram wich in fact is to open a new instagram account.
@fgisslen can u watch it and see if that is what happening with u?

@uluQulu have u seen this before? any clue about what I'm supposed to do ?

This is a temporary fix, but this issue was bypassed by changing:
login_util.py line 116 from "https://www.instagram.com"

to

"https://www.instagram.com/accounts/login"

i'm using headless, then I can't check that, right? @Jenuan

well, you can always turn off headless mode if you want i think you should just put headless=False @fgisslen

@generalu i did change it but i got this error:

Message: no such element: Unable to locate element: {"method":"xpath","selector":"//article/div/div/p/a[text()='Log in']"}

I had the same problem!!! I finally fixed here when I changed the line 174 from login_util.py code to be if len(nav) >= 0 instead len(nav) == 2 --> note: I didn't investigate more this line but I bet this is totally diff than 2 and turns into a false return.

@priscila225 could you post or send me how it is written your login_util.py ? because I did change like you said but it seems instapy can't find the place to log in my username and password.

@Jenuan No I can't turn off headless because it runs on ubuntu server.

@priscila225 Do you know if this is a common problem?

@priscila225 I tried your fix and it seems to work :)

@priscila225 the problem with your fix is that it doesnt seem to tell if the password acctually is wrong

@fgisslen could you post here how is written your login_util.py?

@priscila225

@timgrossmann would you have an idea what is the problem here ? I've been trying to fix my instapy since the last update with no success

Hey @Jenuan
First make sure you got the latest commits I shared recently which solved a misbehavior while logging in and then, if you still get a problem again on logging or anything else, post the full traceback of the console output with the a troubleshoot information to understand your problem and solve it.

I rarely change accounts and recently I did it and faced that issue, so, I am sorry for not being to help you before. I just can't talk about the problems I don't know of.


Cheers 馃榿

I had the same issue and resolved by making the update to the login page as @generalu recommended and also changing line 140 from "//article/div/div/p/a[text()='Log in']")] to the following:

"//button[text()='Log in']")

It looks like the page changed and the html structure changed from "a" to "button". Hope this helps

@dnishiyama could you possibly make a PR about this?

hey @uluQulu sup?
yes I am using the last commits
well, I always fetch origin in my GitHub desktop, or does it not work ?
thx for the help

Actually the problem im facing right now is #2693
it seems that instep id jumping directly to do the work before log in my instagram.

I'm getting Cookie file not found, creating cookie...
Wrong login data!
while running individual accounts on their own Ubuntu droplets - originally to prevent this exact scenario, is there a better way to prevent this error or run multiple accounts?

just wrote a bugfix, are you available to help testing it ? https://github.com/timgrossmann/InstaPy/pull/3384

Was this page helpful?
0 / 5 - 0 ratings