Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Token and auth-token
Hey all.
I have problem which i dont quite understand how to go about from here.
I use request library to sign-in to website and I believe im doing that right. I make a post request to /sign-in page and response to the POST request is following

I basically expecting some html back if the login was successful. But instead I get these token. What do I do with these token from here. My code looks like this.

with requests.Session() as s:
    url = ""
    url2 = ""
    r = s.get(url, headers=headers)
    soup = BeautifulSoup(r.content, 'html5lib')
    login_data['authenticity_token'] = soup.find('input', attrs={'name': 'authenticity_token'})['value']
    r1 =, data=login_data, headers=headers)
    r2 = s.get(url2, headers=headers)
any help would be much appreciated


Just to add more information. Im trying to login to nutmeg account.
Probably the site you are parsing is a kind of SPA application. This kind of sites don't return HTML as a response, they work over AJAX and receive only JSON.

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Google calendar pthon flask auth Kireta 0 405 Sep-16-2019, 04:50 PM
Last Post: Kireta
  Getting csrf token to log in spartanvfl 4 14,219 Aug-08-2019, 08:19 PM
Last Post: NSearch
  Flask tutorial errors in jinja, auth undefined Ecniv 2 484 May-03-2019, 02:04 PM
Last Post: Ecniv
  Problem enabling http auth in a route nikos 2 636 Mar-02-2019, 01:13 PM
Last Post: nikos
  Python /Flask Login with LDAP Auth pythonnubie 4 4,393 Apr-16-2018, 03:14 PM
Last Post: nilamo
  Uninitialized ASN.1 value in Flask LDAP3 Auth blueprint zoidberg 1 1,866 Nov-15-2017, 12:29 PM
Last Post: zoidberg

Forum Jump:

Users browsing this thread: 1 Guest(s)