Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #37689

Re: Need Pattern For Logging Into A Website

Date 2013-01-25 12:18 -0700
From Michael Torrie <torriem@gmail.com>
Subject Re: Need Pattern For Logging Into A Website
References <gp39t9-9rk1.ln1@ozzie.tundraware.com> <3f55e471-8657-4cad-96cd-96e9e2e01a9d@googlegroups.com> <qrnat9-lli2.ln1@ozzie.tundraware.com>
Newsgroups comp.lang.python
Message-ID <mailman.1053.1359142676.2939.python-list@python.org> (permalink)

Show all headers | View raw


On 01/25/2013 09:18 AM, Tim Daneliuk wrote:
> On 01/25/2013 10:01 AM, Steve Petrie wrote:
>> On Thursday, January 24, 2013 8:29:51 PM UTC-5, Tim Daneliuk
>> wrote: The mechanize module
>> (http://wwwsearch.sourceforge.net/mechanize/) might be a place to
>> start.  I've done something similar with code like this:
> Thanks.

I've had good luck using urllib2 and a cookiejar.  Just post your login
credentials against the login url, keep all the cookies and then make
your other requests using that cookiejar.  Besides the Python standard
library docs on urllib2 and cookielib, here's an article that gives an
overview of how to use it:

http://www.techchorus.net/using-cookie-jar-urllib2

This technique has the advantage of not requiring anything outside of
the standard library.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Need Pattern For Logging Into A Website Tim Daneliuk <tundra@tundraware.com> - 2013-01-24 19:29 -0600
  Re: Need Pattern For Logging Into A Website Steve Petrie <spetrie@gmail.com> - 2013-01-25 08:01 -0800
    Re: Need Pattern For Logging Into A Website Tim Daneliuk <tundra@tundraware.com> - 2013-01-25 10:18 -0600
      Re: Need Pattern For Logging Into A Website Michael Torrie <torriem@gmail.com> - 2013-01-25 12:18 -0700
        Re: Need Pattern For Logging Into A Website Tim Daneliuk <tundra@tundraware.com> - 2013-01-25 18:15 -0600
          Re: Need Pattern For Logging Into A Website Michael Torrie <torriem@gmail.com> - 2013-01-25 23:53 -0700
            Re: Need Pattern For Logging Into A Website Tim Daneliuk <tundra@tundraware.com> - 2013-01-26 14:00 -0600
  Re: Need Pattern For Logging Into A Website Jan Wąsak <jhnwsk@gmail.com> - 2013-01-28 00:57 -0800

csiph-web