473,698 Members | 2,747 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 2818

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

Similar topics

4
4459
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
1922
by: Fazer | last post by:
Hello, I was wondering what's the best way of setting timeouts when working with urllib2. Thanks,
0
962
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 used since it always matches from the beginning of the string and the reply from my server had 2 more...
3
2035
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
7404
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
1420
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 _call_chain File "ClientCookie\_urllib2_support.pyo", line 181, in http_error_302 File...
2
4466
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 (minimal code sample):
6
3472
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 = urllib2.build_opener(proxy_support, urllib2.HTTPHandler) urllib2.install_opener(opener)
1
1016
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
8611
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8876
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6531
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5867
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4624
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2341
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.