Need Pattern For Logging Into A Website

Jan Wąsak jhnwsk at gmail.com
Mon Jan 28 03:57:35 EST 2013


On Friday, January 25, 2013 2:29:51 AM UTC+1, Tim Daneliuk wrote:
> I need to write a Python script to do the following:
> 
> 
> 
>    - Connect to a URL and accept any certificate - self-signed or authoritative
> 
>    - Provide login name/password credentials
> 
>    - Fill in some presented fields
> 
>    - Hit a "Submit" button
> 
> 
> 
> Why?  Because I don't want to have to start a browser and do this
> 
> interactively every time I authenticate with a particular server.
> 
> I want to do this at the command line with no interactive intervention.
> 
> 
> 
> I know Python pretty well.  I don't quite know how to do this and
> 
> was hoping someone had a simple pattern they could share for
> 
> doing this.
> 
> 
> 
> TIA,
> 

Hello Tim,

I think you may also want to take a look at python requests.
http://docs.python-requests.org/en/latest/user/advanced/

>From my experience they do a much nicer job than urllib and anything I've tried.
You will probably get what you want out of them easily and in no time.

-- 
cheers,
john



More information about the Python-list mailing list