473,569 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with: urllib2.build_o pener(urllib2.H TTPCookieProces sor(cj))

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.Mozil laCookieJar()
os.environ["http_proxy "] = "http://proxy.irm.at:12 34"
os.environ['HOME']= r"C:\tmp\COOKIE "
#
cj.load(os.path .join(os.enviro n["HOME"], "cookies.tx t"))
opener = urllib2.build_o pener(urllib2.H TTPCookieProces sor(cj))
r = opener.open("ht tp://brokerjet.ecetr a.com/at/news/?/")

Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "C:\Programme\P ython24\lib\url lib2.py", line 358, in open
response = self._open(req, data)
File "C:\Programme\P ython24\lib\url lib2.py", line 376, in _open
'_open', req)
File "C:\Programme\P ython24\lib\url lib2.py", line 337, in _call_chain
result = func(*args)
File "C:\Programme\P ython24\lib\url lib2.py", line 1021, in http_open
return self.do_open(ht tplib.HTTPConne ction, req)
File "C:\Programme\P ython24\lib\url lib2.py", line 996, in do_open
raise URLError(err)
urllib2.URLErro r: <urlopen error (10061, 'Connection refused')>
Sep 5 '05 #1
0 2810

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4449
by: bmiras | last post by:
I've got a problem using urllib2 to get a web page. I'm going through a proxy using user/password authentification and i'm trying to get a page asking for a HTTP authentification. And I'm using python 2.3 Here is an exemple of the piece of code I use: import urllib2 #Proxy handler proxy_handler = urllib2.ProxyHandler({"http" :
3
1919
by: Fazer | last post by:
Hello, I was wondering what's the best way of setting timeouts when working with urllib2. Thanks,
0
953
by: Catalin Marinas | last post by:
Hi, I was trying to use the HTTPBasicAuthHandler with an MS web server requiring authentication (basic) but without success. I digged a bit in the urllib2 module (python 2.3.4) and it turned out to be a problem with the regular expression matching in the AbstractBasicAuthHandler.http_error_auth_reqed() function. The rx.match() cannot be...
3
2024
by: Volker M. | last post by:
Hey, I want to open a list of URLs with Pythons urllib and the fuction open(URL) automatically. It is important that the program open ONLY normal http-sites and no https-sites with user/password-request. So exists a possibility that I could cancel all site requests with user/password-dialogues? Thx
5
7385
by: Pascal | last post by:
Hello, I want to acces my OWA (Outlook Web Acces - http Exchange interface) server with urllib2 but, when I try, I've always a 401 http error. Can someone help me (and us)? Thanks. here's my pyscript:
0
1416
by: Robert | last post by:
using a proxy and https/SSL together I get the following SSL error : File "dscore.pyo", line 2257, in UrlOpenEx File "ClientCookie\_urllib2_support.pyo", line 572, in open File "ClientCookie\_urllib2_support.pyo", line 472, in http_response File "ClientCookie\_urllib2_support.pyo", line 589, in error File "urllib2.pyo", line 304, in...
2
4442
by: Ant | last post by:
Hi all, I have just moved to a new machine, and so have installed the latest version of Python (2.4.3 - previously I believe I was running 2.4.2). Unfortunately this seems to have broken urllib2... An app I wrote for testing our web application makes heavy use of urllib2 against the localhost, and I am getting the following problem...
6
3455
by: Jack | last post by:
I'm trying to use a proxy server with urllib2. So I have managed to get it to work by setting the environment variable: export HTTP_PROXY=127.0.0.1:8081 But I wanted to set it from the code. However, this does not set the proxy: httpproxy = '127.0.0.1:3129' proxy_support = urllib2.ProxyHandler({"http":"http://" + httpproxy}) opener =...
1
1010
by: Rob Wolfe | last post by:
"Miguel Beltran R." <yourpadre@gmail.comwrites: You forgot to add the authentication handler to the list of handlers. See below. Add here: opener.add_handler(aut))
0
7698
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7970
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.