[Tutor] Accessing a secured webpage

ian douglas ian.douglas at iandouglas.com
Fri Jan 28 23:15:52 CET 2011


If it's HTTP basic_auth, you could try this method too:

http://username:password@domain.com/page.html


On 01/28/2011 01:54 PM, Karim wrote:
>
> Hello,
>
> I want to create a client to access a webpage. But when I access it 
> interactively  there is a dialog box
> which ask for login and password.
> I want to access it in batch via python but I could only found a basic 
> example:
> ||#||!/bin/env||  ||python|
> |#||  ||-*-||  ||coding:||  ||utf-8||  ||-*-|
>
> |import|  urllib2
> reponse|=|  urllib2.|urlopen|(|'||http||:||/||/||www||.||kernel||.||org||/||'|)
> xhtmldata|=|  reponse.|read|()
> |for|  num,ligne|in|  |enumerate|(xhtmldata.|splitlines|()) :
>      |print|  |"||%04d||  ||-||  ||%s||"||%|(num,ligne)
> |
> I want to provide login and password via python code. The web adress 
> is like http://website.com:8081/ddts/ddts_main.
> If you have link it is welcome!
>
> Regards
> Karim
>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110128/78db2f31/attachment.html>


More information about the Tutor mailing list