Alex R. Alex R. - 3 months ago 36
Python Question

Setting up a login with python requests for

I'm trying to write a resume searcher for (there's no API for resumes unfortunately). Specifically, I need to provide login details (to get names from resumes). The login page is here:

I was following a guide here:

My code so far is:

import requests
from lxml import html
session_requests = requests.session()

login_url = ""
result = session_requests.get(login_url)

tree = html.fromstring(result.text)

'_email': '',
'_password': 'mypassword'

result =
data = payload,
headers = dict(referer=login_url)

This doesn't seem to work quite right. First off, I think I'm missing some authentication tokens. After inspecting the login page, I think it might be the "surftok" attribute, but I'm not completely sure. Is this even possible just with the requests module, or will I need Selenium or mechanize to make this work?


You're missing multiple data fields.

This worked for me

import requests
data = {
        '__email':'Your Email',
        '__password':'Your password',

response ='',data=data)