I'm trying to modify my code that allows a user to login to okcupid.com. The following code worked fine for several months:
session = requests.Session()
credentials = {'username': username, 'password': password, 'dest': '/home'}
login_response = session.post('https://www.okcupid.com/login', data=credentials)
if login_response.url == 'https://www.okcupid.com/login':
raise AuthenticationError('Could not log in with the credentials provided')
When the username and password variables were correct, the rest of the code would run, otherwise the authentication error would be raised. Now, however, correct login information returns a login_response.url
of https://www.okcupid.com/login?dest=%2fhome but the session doesn't treat the user as being logged in. Some sort of authentication is still happening though, as incorrect login information still raises the authentication error. Any thoughts?