Re: urllib.urlopen blocking?

2010-05-11 Thread Antoine Pitrou
On Tue, 11 May 2010 07:35:52 -0700 (PDT) Dominik Gabi wrote: > > For the record, have you tried calling gobject.threads_init() at the > > beginning of your application (just after importing all modules)? > > I haven't... now it works, thanks :) Any tips on how to avoid mistakes > like that in th

Re: urllib.urlopen blocking?

2010-05-11 Thread Dominik Gabi
> For the record, have you tried calling gobject.threads_init() at the > beginning of your application (just after importing all modules)? I haven't... now it works, thanks :) Any tips on how to avoid mistakes like that in the future? I'm somewhat confused as to how I was supposed to get this out

Re: urllib.urlopen blocking?

2010-05-11 Thread Antoine Pitrou
On Tue, 11 May 2010 06:22:29 -0700 (PDT) Dominik Gabi wrote: > > I'm new to python and have been playing around with it for a few days > now. So please forgive me if this is a stupid question :) > > I've tried writing a little application with pygtk and urllib. For the record, have you tried ca

Re: urllib.urlopen fails in Emacs

2008-09-26 Thread Niklas Norrthon
On 26 Sep, 12:21, Wojtek Walczak <[EMAIL PROTECTED]> wrote: > On Fri, 26 Sep 2008 02:23:18 -0600, Iain Dalton wrote: > > InEmacs, using run-python, > > >     import urllib > >    urllib.urlopen('http://www.google.com/') > > > results in this traceback: > ... > >     IOError: [Errno socket error] (1

Re: urllib.urlopen fails in Emacs

2008-09-26 Thread Wojtek Walczak
On Fri, 26 Sep 2008 02:23:18 -0600, Iain Dalton wrote: > In Emacs, using run-python, > > import urllib > urllib.urlopen('http://www.google.com/') > > results in this traceback: ... > IOError: [Errno socket error] (111, 'Connection refused') > > It works fine from the command line. Why

Re: urllib.urlopen unwanted password prompts - documentation problem

2006-12-27 Thread John J. Lee
John Nagle <[EMAIL PROTECTED]> writes: >If you try to open a password protected page with "urllib.urlopen()", you > get > > "Enter username for EnterPassword at example.com:" > > on standard output, followed by a read for input! This seems to be an > undocumented feature, if not a bu

Re: urllib.urlopen: Errno socket error

2006-11-09 Thread frifri007
[EMAIL PROTECTED] a écrit : > Hi, > > I'm just trying to read from a webpage with urllib but I'm getting > IOErrors. This is my code: > > import urllib > sock = urllib.urlopen("http://www.google.com/";) > > and this is the error: > > Traceback (most recent call last): > File "", line 1, in >

Re: urllib.urlopen: Errno socket error

2006-10-17 Thread kgrafals
Dennis, I tried a ProxyHandler with the following code ... proxy_support = urllib2.ProxyHandler({}) opener = urllib2.build_opener(proxy_support) urllib2.install_opener(opener) ... but it's giving me the same result. Then I tried to tunnel using code from ... http://aspn.activestate.com/ASPN/Co

Re: urllib.urlopen: Errno socket error

2006-10-16 Thread kgrafals
Hi Salvatore, Even if I catch the exceptions in a loop it goes on forever. - ken -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib.urlopen: Errno socket error

2006-10-16 Thread Salvatore
Hello, Try to increase the time out : socket.settimeout(n) and catch the timeout error when it occurs Regards [EMAIL PROTECTED] a écrit : > Hi, > > I'm just trying to read from a webpage with urllib but I'm getting > IOErrors. This is my code: > > import urllib > sock = urllib.urlopen("http:/

Re: urllib.urlopen() with pages that requires cookies.

2006-04-29 Thread John J. Lee
"mwt" <[EMAIL PROTECTED]> writes: > Fredrik Lundh wrote: [...] > > use urllib2 and cookielib. here's an outline: > > > > import urllib2, cookielib > > > > # set things up > > jar = cookielib.CookieJar() > > handler = urllib2.HTTPCookieProcessor(jar) > > opener = urllib2.build_

Re: urllib.urlopen() with pages that requires cookies.

2006-04-27 Thread mwt
Fredrik Lundh wrote: > Øyvind Østlund wrote: > > > I am trying to visit a limited amount of web pages that requires cookies. I > > will get redirected if my application does not handle them. I am using > > urllib.urlopen() to visit the pages right now. And I need a push in the > > right direction

Re: urllib.urlopen() with pages that requires cookies.

2006-04-27 Thread Fredrik Lundh
Øyvind Østlund wrote: > I am trying to visit a limited amount of web pages that requires cookies. I > will get redirected if my application does not handle them. I am using > urllib.urlopen() to visit the pages right now. And I need a push in the > right direction to find out how to deal with page

Re: urllib.urlopen and https question

2006-01-10 Thread doobiz
Does anyone have an entire (simple) script for someone new to programming and Python that will illustrate how to open an https site and log on to it (with the script providing the username and password, if that's possible). Thanks very much. rpd "Electricity is actually made up of extremely tiny

Re: urllib.urlopen and https question

2006-01-10 Thread bowman . joseph
That's what I get for scimming the documentation too quickly. Got it, thanks! For anyone else working on something similar, here is all I did... mind you, this is my first experience with python. # subclass of FancyURLopener so we can override the prompt_user_password method class DBCheckUrlOpen

Re: urllib.urlopen and https question

2006-01-10 Thread [EMAIL PROTECTED]
>From the docs for urllib: When performing basic authentication, a FancyURLopener instance calls its prompt_user_passwd() method. The default implementation asks the users for the required information on the controlling terminal. A subclass may override this method to support more appropriate beha

Re: urllib.urlopen

2005-12-18 Thread Tom Anderson
On Sat, 17 Dec 2005, Dennis Lee Bieber wrote: > (Now there is an interesting technical term: > #define ERROR_ARENA_TRASHED 7) FreeBSD at one point had an EDOOFUS; Apple kvetched about this being offensive, so it was changed to EDONTPANIC. I shitteth thee not. tom -- information distribut

Re: urllib.urlopen

2005-12-18 Thread JabaPyth
Thanks, guys. I tried on a different computer, and it worked fine.I then found out that my computer thyought i had a proxy server, and after i cleaned that up, it worked. Thanks again -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib.urlopen

2005-12-18 Thread gene tani
Jay wrote: > Easy Fix... > > import urllib > the_url = "http://www.google.com"; > req = urllib.urlopen(the_url) > > Does this work for you?? This does look like proxie /firewall issue, try it from an internet cafe. Also depending on the site, you may have to set User-Agnet and/or referer headers

Re: urllib.urlopen

2005-12-17 Thread Jay
Easy Fix... import urllib the_url = "http://www.google.com"; req = urllib.urlopen(the_url) Does this work for you?? -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib.urlopen

2005-12-17 Thread JabaPyth
I tried using urllib2 and this is what i got: >>import urllib2 >>the_url = 'http://www.google.com' >>req = urllib2.Request(the_url) >>handle = urllib2.urlopen(req) Traceback (most recent call last): File "", line 1, in ? File "C:\Python24\lib\urllib2.py", line 130, in urlopen return _opener

Re: urllib.urlopen

2005-12-17 Thread Xavier Morel
JabaPyth wrote: > Hello, > I'm trying to use the urllib module, but when i try urllib.urlopen, it > gives me a socket error: > > >>import urllib > >>print urllib.urlopen('http://www.google.com/').read() > Traceback (most recent call last): > File "", line 1, in ? > File "C:

Re: urllib.urlopen doesn't work

2005-09-02 Thread Steve Holden
Josef Cihal wrote: > Hallo, > > i need a help with module URLLIB. > > I am trying to open url via: > -urllib.urlopen > ('http://brokerjet.ecetra.com/at/markets/stocks/indices.phtml?notation=92866') > > > Problem is, that I am always redirecting to > - LOGIN page (www.brokerjet.at