Movatterモバイル変換


[0]ホーム

URL:


urllib with user/password

Steve Holdensholden at holdenweb.com
Sat Apr 7 17:52:29 EDT 2001


"Gilles Lenfant" <glenfant.nospam at bigfoot.com> wrote in messagenews:9ao1v9$2tot$1 at news5.isdnet.net...> Hi,>> I got a robot that fetches with urllib.urlopen() a user/password protected> page.> As some URLs reply with code 401 (basic authentication), I'm prompted for> the user/password.>> Is there a workaround for storing the user/password in the script and go> through the request without prompting ?>> Thanks in advance>One fairly simple way would be to use a URL of the formhttp://user:password@host/path/file.extwhich will, of course, send the password and username in clear over the net.Since basic authentication doesn't do much better (simply encodinguser:password in base64) this may not be a problem.Hope this helps.regards Steve


More information about the Python-listmailing list

[8]ページ先頭

©2009-2025 Movatter.jp