I am trying to log in to a website using python and the requests
module.
I am doing:
import requests
payload = {
'login_Email': 'xxxxx@gmail.com',
'login_Password': 'xxxxx'
}
with requests.Session() as s:
p = s.post('https://www.auction4cars.com/', data=payload)
print p.text
The problem is, that the output of this just seems to be the login page and not the page AFTER log in. I.e. the page says 'welcome guest' and 'please enter your username and password' etc.
I was expecting it to return the page saying something like 'thanks for logging in xxxxx' etc.
Can anyone suggest what I'm doing wrong?
EDIT:
I don't think my question is a duplicate of How to "log in" to a website using Python's Requests module? because I am using the script from the most popular answer (regarded on the thread as the answer that should be the accepted one).
I have also tried the accepted one, but my problem remains.
EDIT:
I confused about whether I need to do something with cookies. The URLs that I am trying to visit after logging in don't seem to contain cookie values.
EDIT:
This seems to be a similar problem to mine:
get restricted page after login using requests,urllib2 python
However, I don't see other inputs that I need to fill out. Except:
Do I need to do anything with the submit button?