469,645 Members | 1,120 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

Problem with: urllib2.build_opener(urllib2.HTTPCookieProcessor(c j))

Hi,

I get an error, when I am trying to download URL with using Cookies.
Where is the Problem?

Thank u very much for all ideas!!!

sincerely

Josef
import os, cookielib, urllib2
cj = cookielib.MozillaCookieJar()
os.environ["http_proxy"] = "http://proxy.irm.at:1234"
os.environ['HOME']= r"C:\tmp\COOKIE"
#
cj.load(os.path.join(os.environ["HOME"], "cookies.txt"))
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(c j))
r = opener.open("http://brokerjet.ecetra.com/at/news/?/")

Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "C:\Programme\Python24\lib\urllib2.py", line 358, in open
response = self._open(req, data)
File "C:\Programme\Python24\lib\urllib2.py", line 376, in _open
'_open', req)
File "C:\Programme\Python24\lib\urllib2.py", line 337, in _call_chain
result = func(*args)
File "C:\Programme\Python24\lib\urllib2.py", line 1021, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "C:\Programme\Python24\lib\urllib2.py", line 996, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error (10061, 'Connection refused')>
Sep 5 '05 #1
0 2677

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by bmiras | last post: by
3 posts views Thread by Fazer | last post: by
reply views Thread by Catalin Marinas | last post: by
3 posts views Thread by Volker M. | last post: by
5 posts views Thread by Pascal | last post: by
reply views Thread by Robert | last post: by
2 posts views Thread by Ant | last post: by
6 posts views Thread by Jack | last post: by
1 post views Thread by Rob Wolfe | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.