Re: urllib2 and threading

2009-05-01 Thread robean
eturl() # obviously, do something more useful here,eventually page.close() ulock.release() with else: pass the urllib2 starts raising URLErrros after the first 3 - 5 urls have been visited. Do you have any sense what in the threads is corrupting urllib2's behavior? Many thank

urllib2 and threading

2009-04-30 Thread robean
I am writing a program that involves visiting several hundred webpages and extracting specific information from the contents. I've written a modest 'test' example here that uses a multi-threaded approach to reach the urls with urllib2. The actual program will involve fairly elaborate scraping and p

Re: Professional quality scripts/code

2008-10-04 Thread robean
On Oct 3, 1:26 am, Bruno Desthuilliers wrote: > robean a crit : > > > I have been learning Python for the last 3 months or so and I have a > > working (but somewhat patchy) sense of the the language. I've been > > using a couple of the more popular Python books as

Professional quality scripts/code

2008-10-02 Thread robean
I have been learning Python for the last 3 months or so and I have a working (but somewhat patchy) sense of the the language. I've been using a couple of the more popular Python books as well as online resources. A question for experienced Python programmers: can you recommend resources where I ca

Re: urllib2 and exceptions

2008-09-28 Thread robean
On Sep 28, 5:33 pm, alex23 <[EMAIL PROTECTED]> wrote: > On Sep 29, 5:52 am, robean <[EMAIL PROTECTED]> wrote: > > > Actually, the problem seems to be that IOError is in my namespace, but > > the other error classes are not. So, > > >    except HTTPError

Re: urllib2 and exceptions

2008-09-28 Thread robean
On Sep 28, 12:27 pm, robean <[EMAIL PROTECTED]> wrote: > On Sep 28, 12:11 pm, "Chris Rebert" <[EMAIL PROTECTED]> wrote: > > > > > On Sun, Sep 28, 2008 at 11:03 AM, robean <[EMAIL PROTECTED]> wrote: > > > Hi everyone, > > > > I have

Re: urllib2 and exceptions

2008-09-28 Thread robean
On Sep 28, 12:11 pm, "Chris Rebert" <[EMAIL PROTECTED]> wrote: > On Sun, Sep 28, 2008 at 11:03 AM, robean <[EMAIL PROTECTED]> wrote: > > Hi everyone, > > > I have a question about using urllib2. > > > I like urllib2 better than urllib at least in p

urllib2 and exceptions

2008-09-28 Thread robean
Hi everyone, I have a question about using urllib2. I like urllib2 better than urllib at least in part because it has more elaborate support for handling errors: there is built in support for URLError (for faulty urls) and HTTPError (for http errors that might originate from, say, passing an inva