Skip to content

Instantly share code, notes, and snippets.

@palcu
Created August 24, 2016 21:52
Show Gist options
  • Save palcu/a01b664363fa91146ceaf4292ecbfbd9 to your computer and use it in GitHub Desktop.
Save palcu/a01b664363fa91146ceaf4292ecbfbd9 to your computer and use it in GitHub Desktop.

Revisions

  1. palcu created this gist Aug 24, 2016.
    17 changes: 17 additions & 0 deletions infoarena.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    In [25]: session = requests.Session()

    In [27]: data = {'username':'palcuiealex', 'password':"bla"}

    In [28]: url
    Out[28]: 'https://infoarena.ro/login'

    In [29]: session.post(url, data=data)
    Out[29]: <Response [200]>

    In [30]: session.cookies
    Out[30]: <RequestsCookieJar[Cookie(version=0, name='__cfduid', value='d83d1879d0e74648f5f40b768b49645561472075137', port=None, port_specified=False, domain='.infoarena.ro', domain_specified=True, domain_initial_dot=True, path='/', path_specified=True, secure=False, expires=1503611137, discard=False, comment=None, comment_url=None, rest={'HttpOnly': None}, rfc2109=False), Cookie(version=0, name='infoarena2_session', value='2k9s4529debpndu04k358i5l47', port=None, port_specified=False, domain='.infoarena.ro', domain_specified=True, domain_initial_dot=True, path='/', path_specified=True, secure=False, expires=None, discard=True, comment=None, comment_url=None, rest={}, rfc2109=False)]>

    In [31]: resp = session.get('http://www.infoarena.ro/account')

    In [32]: 'Contul meu' in resp.content
    Out[32]: True