[Tutor] Accessing a secured webpage
Steven D'Aprano
steve at pearwood.info
Sat Jan 29 05:30:58 CET 2011
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.
You should read this:
http://www.voidspace.org.uk/python/articles/authentication.shtml
or this French translation:
http://www.voidspace.org.uk/python/articles/authentication_francais.shtml
> 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 don't understand why your code has been filled with vertical pipe
characters |
--
Steven
More information about the Tutor
mailing list