login - Could not post data with Python -


this have far. attempting login , view members page can't seem accomplish that. appreciated!

import requests   s = requests.session() url = 'http://theocarinanetwork.com/login'                     uname = 'username'                                                                pw = 'password'   headers = {'user-agent': 'mozilla/5.0 (x11; linux x86_64) applewebkit/535.11 (khtml, gecko) chrome/17.0.963.56 safari/535.11',            'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',            'accept-encoding': 'gzip,deflate,sdch',                              'accept-language': 'en-us,en;q=0.8',                                 'accept-charset': 'iso-8859-1,utf-8;q=0.7,*;q=0.3'}  data = {'uname':uname,                                                                   'pw':pw,                                                                 'submit':'button',                                                   'base_uri':'http://theocarinanetwork.com/index'}  response = s.post(url, headers = headers)  if response.status_code == 200:  response = s.get('http://theocarinanetwork.com/members/')  print response.text 

import requests   s = requests.session() url = 'http://theocarinanetwork.com/login/log_in'                     uname = '******'                                                                pw = '******'   headers = {'user-agent': 'mozilla/5.0 (x11; linux x86_64) applewebkit/535.11 (khtml, gecko) chrome/17.0.963.56 safari/535.11',        'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',        'accept-encoding': 'gzip,deflate,sdch',                          'accept-language': 'en-us,en;q=0.8',                             'accept-charset': 'iso-8859-1,utf-8;q=0.7,*;q=0.3'} data = {'uname':uname,                                                               'pw':pw,                                                             'submit':'button',                                               'base_uri':'http://theocarinanetwork.com/index'}  response = s.post(url, data, headers = headers)  if response.status_code == 200:      response = s.get('http://theocarinanetwork.com/members/')     print response.text 

Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -