Instapy: login issue

Created on 28 Jun 2017  路  11Comments  路  Source: timgrossmann/InstaPy

Everything was working perfectly until this morning. For some reason, the script is now launching the webdriver and is going to the create an account page not the log in. causing the script to fail.

I haven't changed anything which is really weird, can't put my finger on why it would just stop working...

Has anyone encountered this?

bug help wanted

Most helpful comment

Guys, if your OS language is English, go ahead and comment the line 10 in login_util.py. And it starts working again.

'# Changes instagram language to english, to ensure no errors ensue from having the site on a different language
"""browser.find_element_by_xpath("//footer[@Class='_oofbn']/div[@Class='_mhrsk _pcuq6']/nav["
"@class='_p1gbi']/ul[@Class='_fh0f2']/li[@Class='_fw3ds'][10]/"
"span[@Class='_17z9g']/select[@Class='_nif11']/option"
"[text()='English']").click()"""

All 11 comments

Just got the same issue. Instagram probably pushed an update.

https://github.com/timgrossmann/InstaPy/blob/c3e7b19765bbead9cde71fb6e27ccaabc2c863dc/instapy/login_util.py#L10 Looks like this element is missing now?

In a mean way, im glad im not the only one! Yeah it must have been an update :/

Hi guys, looks like I got the same thing. Here's my error

Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\InstaPy-master\quickstart.py", line 4, in
session.login()
File "C:\Users\Administrator\Desktop\InstaPy-master\instapy\instapy.py", line 80, in login
if not login_user(self.browser, self.username, self.password):
File "C:\Users\Administrator\Desktop\InstaPy-master\instapy\login_util.py", line 10, in login_user
browser.find_element_by_xpath("//footer[@class='_oofbn']/div[@class='_mhrsk _pcuq6']/nav["
File "C:\Program Files (x86)\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 313, in find_element_by_xpath
return self.find_element(by=By.XPATH, value=xpath)
File "C:\Program Files (x86)\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 791, in find_element
'value': value})['value']
File "C:\Program Files (x86)\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 256, in execute
self.error_handler.check_response(response)
File "C:\Program Files (x86)\Python36-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 194, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//footer[@class='_oofbn']/div[@class='_mhrsk _pcuq6']/nav[@class='_p1gbi']/ul[@class='_fh0f2']/li[@class='_fw3ds'][10]/span[@class='_17z9g']/select[@class='_nif11']/option[text()='English']"}
(Session info: chrome=59.0.3071.115)
(Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.14393 `x86_64)

Guys, if your OS language is English, go ahead and comment the line 10 in login_util.py. And it starts working again.

'# Changes instagram language to english, to ensure no errors ensue from having the site on a different language
"""browser.find_element_by_xpath("//footer[@Class='_oofbn']/div[@Class='_mhrsk _pcuq6']/nav["
"@class='_p1gbi']/ul[@Class='_fh0f2']/li[@Class='_fw3ds'][10]/"
"span[@Class='_17z9g']/select[@Class='_nif11']/option"
"[text()='English']").click()"""

Thanks @urmilsetia, commented out as suggested and it is working again. It looks like the class for the login changed (a class="_fcn8k"), but not 100% how to update the code correctly, so went with your method.

@urmilsetia aren't you crashing on launching with line 10 commented out? I am.

@urmilsetia all good, my mistake. Love your work.

Yup, just a temporary work around.

@urmilsetia Thank you for your help.

I'll try to check this this evening... I temporarily removed the part from the login_util.

Please find below the fix they added the class of _c4mil_ to the span element. Addition in bold+italic (I don't know how to submit that as a pull request?)

browser.find_element_by_xpath("//footer[@class='_oofbn']/div[@class='_mhrsk _pcuq6']/nav["
"@class='_p1gbi']/ul[@class='_fh0f2']/li[@class='_fw3ds'][10]/"
"span[@class='_17z9g __c4mil_']/select[@class='_nif11']/option"
"[text()='English']").click()

347 fixes it

Was this page helpful?
0 / 5 - 0 ratings