How to use urllib2.BaseHandler class

Doug Farrell writeson at charter.net
Fri Jul 9 21:18:11 CEST 2004


Hi all,

I'm trying to build a web page crawler to help us build our websites,
which are driven by static pages after they are called the first time.
Anyway, I can use urllib2.urlopen() no problem, but I'd like to have
more control over the process. In particular I'd like to get back the
HTTP status code from the request, even if it's a 200. It looks like I
can do that by deriving my own class from HTTPHandler, but I'm not
sure how to go about it. Can anyone direct me to some useful example
code for this kind of thing?

Thanks in advance,
Doug Farrell



More information about the Python-list mailing list