[Tutor] Help with CGI login

dman dsh8290@rit.edu
Wed, 15 Aug 2001 23:22:04 -0400


On Wed, Aug 15, 2001 at 08:05:50PM -0700, James wrote:
| Hi,
| 
| Thanks largely to the discussion and help on this list, I was able
| offer my 'services' to help download the 25000 mssgs archived from
| another list I belong to.  Unfortunately, I couldn't get it going in
| time, and these archives have since gone offline; they're only
| available to listowners now.  To get at them, I have to log on here:  
| 
| http://www.listbot.com/cgi-bin/customer?Act=NULL
| 
| I tried to login using my browser, then running my script to
| download the mssgs, but it doesn't work.  Idealy, I could just add
| some lines to my script to login automatically, but I don't know how
| to do this.  

Login with your browser.  Make a note of the URL that is used.  That
is, identify all form fields and their values.  Forms are submitted in
the URL.  For example, with my DSL connection I need to login via a
web form.  A big PITA so instead I made a little python script that
gets run when the interface is brought up.  The core looks like this :

    urllib.urlopen(
        "http://www2.frontierdsl.com:9061/dashboard?fcn=serviceLogon&"
        + "service=frontiernet.dsl&username=myname&password=mypassword").read()

I included the read() just so that the data is retrieved from the
server, if it cares.

HTH,
-D