🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.python
Article #27879

Re: pobieranie pliku + autoryzacja

#27879
From: Desper0
Date: Thu, 13 Jan 2011 13:26
19 lines
2012 bytes
On 13 Sty, 09:34, Trimar <trima...@poczta.onet.pl> wrote:
> W dniu 2011-01-13 00:18, Desper0 pisze:> -------------------8<------------------------------------------------------­--
> > Oraz komunikat b du:
> > HTTP Error 401: Unauthorized
> > Traceback (most recent call last):
> >    File "D:\workspace\parsXml\src\parser.py", line 40, in<module>
> >      the_page = response.read()
> > NameError: name 'response' is not defined
>
> Witam
> Mo e zobacz tak
> authentication_handler=urllib.HTTPBasicAuthHandler(urllib.HTTPPasswordMgrWi­thDefaultRealm())
>             authentication_handler.add_password(None,url2,'user','password')
>              auth_opener = urllib.build_opener(authentication_handler)
>              urllib.install_opener(auth_opener)
>             req = urllib.Request(url2)

Niestety,
efekt ten sam :401
Technical Details
Message-ID: <c7cca82f-ec09-481c-b1ca-715b98b11e73@u3g2000vbj.googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.glorb.com!postnews.google.com!u3g2000vbj.googlegroups.com!not-for-mail
References: <e62ff482-6c5b-4eef-b0d4-fcccb68a182e@j29g2000yqm.googlegroups.com> <igmdfu$ptd$1@news.onet.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.glorb.com!postnews.google.com!u3g2000vbj.googlegroups.com!not-for-mail
From: Desper0 <ansic.soft@gmail.com>
Newsgroups: pl.comp.lang.python
Subject: Re: pobieranie pliku + autoryzacja
Date: Thu, 13 Jan 2011 05:26:03 -0800 (PST)
Organization: http://groups.google.com
Lines: 23
Message-ID: <c7cca82f-ec09-481c-b1ca-715b98b11e73@u3g2000vbj.googlegroups.com>
References: <e62ff482-6c5b-4eef-b0d4-fcccb68a182e@j29g2000yqm.googlegroups.com> <igmdfu$ptd$1@news.onet.pl>
NNTP-Posting-Host: 91.150.137.78
Mime-Version: 1.0
X-Trace: posting.google.com 1294925164 18119 127.0.0.1 (13 Jan 2011 13:26:04 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 13 Jan 2011 13:26:04 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: u3g2000vbj.googlegroups.com; posting-host=91.150.137.78; posting-account=dOGb0woAAABYgbo_KkreKbF4CXejzAEs
User-Agent: G2/1.0
X-HTTP-UserAgent: Opera/9.80 (Windows NT 6.1; U; pl) Presto/2.7.62 Version/11.00,gzip(gfe)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit