1

I'm trying to log in to Instagram using instapy (0.6.16) using the following code

from instapy import Instapy
InstaPy(username="my_username", password="my_password").login()

The two steps of connection checklist and cookie creation seems to work fine, but I got the following error:

INFO [2023-03-07 14:13:21] [my_username]  - Cookie file not found, creating cookie...
WARNING [2023-03-07 14:13:52] [my_username]  Login A/B test detected! Trying another string...
WARNING [2023-03-07 14:13:57] [my_username]  Could not pass the login A/B test. Trying last string...
ERROR [2023-03-07 14:14:02] [my_username]  Login A/B test failed!
        b"Message: Unable to locate element: //div[text()='Log In']\nStacktrace:\nRemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8\nWebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:180:5\nNoSuchElementError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:392:5\nelement.find/</<@chrome://remote/content/marionette/element.sys.mjs:133:16\n"

Suggestions?

1 Answers1

0

Same issue. I replaced

    "login_elem_no_such_exception_2": "//div[text()='Log In']",

by

    "login_elem_no_such_exception_2": "//div[text()='Log in']",

in xpath_compile.py and it worked. Seems that the character case changes according to the countries you are executing the script

Robz
  • 11
  • 2