I am trying to login to Instagram with python. I am able to get the csrf Token but the requests.Session().post() doesn't seem to post the login data to the website correctly. I always get the class="no-js not-logged-in client-root". I've been searching for a while and also tried to login into some random sites which seemed to work. In the login method I just start a requests.Session() and make a post request to the https://www.instagram.com/accounts/login/ with the login name and password as the data parameter.
def login(self):
with requests.Session() as s:
p = s.post(self.loginUrl, data=self.loginData, allow_redirects=True)
Also please don't tell me to use Selenium I strictly want to do it with requests.