Article View: pl.comp.lang.python
Article #27882Re: pobieranie pliku + autoryzacja
From: Trimar
Date: Sun, 16 Jan 2011 15:14
Date: Sun, 16 Jan 2011 15:14
18 lines
1911 bytes
1911 bytes
W dniu 2011-01-13 16:23, Desper0 pisze: > On 13 Sty, 15:59, Trimar<trima...@poczta.onet.pl> wrote: >> W dniu 2011-01-13 14:26, Desper0 pisze: >> >>>> Mo e zobacz tak >>>> authentication_handler=urllib.HTTPBasicAuthHandler(urllib.HTTPPasswordMgrWithDefaultRealm()) >>>> authentication_handler.add_password(None,url2,'user','password') >>>> auth_opener = urllib.build_opener(authentication_handler) >>>> urllib.install_opener(auth_opener) >>>> req = urllib.Request(url2) >> > reply: 'HTTP/1.1 302 Found\r\n' OK jest redirect wiec zamiast url2 w authentication_handler.add_password(None,url2,'user','password') daj authentication_handler.add_password(None,'hrrp://www.sss.com','user','password') i powinno działać Trimar
Technical Details
Message-ID:
<igv20h$1sf$1@news.onet.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!.POSTED!not-for-mailReferences:
<e62ff482-6c5b-4eef-b0d4-fcccb68a182e@j29g2000yqm.googlegroups.com> <igmdfu$ptd$1@news.onet.pl> <c7cca82f-ec09-481c-b1ca-715b98b11e73@u3g2000vbj.googlegroups.com> <ign40u$e8q$1@news.onet.pl> <82bb0446-f5df-43d8-aa19-5df618f39610@v17g2000vbo.googlegroups.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!.POSTED!not-for-mail From: Trimar <trimar12@poczta.onet.pl> Newsgroups: pl.comp.lang.python Subject: Re: pobieranie pliku + autoryzacja Date: Sun, 16 Jan 2011 16:14:05 +0100 Organization: http://onet.pl Lines: 18 Message-ID: <igv20h$1sf$1@news.onet.pl> References: <e62ff482-6c5b-4eef-b0d4-fcccb68a182e@j29g2000yqm.googlegroups.com> <igmdfu$ptd$1@news.onet.pl> <c7cca82f-ec09-481c-b1ca-715b98b11e73@u3g2000vbj.googlegroups.com> <ign40u$e8q$1@news.onet.pl> <82bb0446-f5df-43d8-aa19-5df618f39610@v17g2000vbo.googlegroups.com> NNTP-Posting-Host: stallman.rootnode.net Mime-Version: 1.0 X-Trace: news.onet.pl 1295190865 1935 89.248.165.10 (16 Jan 2011 15:14:25 GMT) X-Complaints-To: niusy@onet.pl NNTP-Posting-Date: Sun, 16 Jan 2011 15:14:25 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 In-Reply-To: <82bb0446-f5df-43d8-aa19-5df618f39610@v17g2000vbo.googlegroups.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit