Re: urllib2: handle an error (302)

2007-09-11 Thread Antoni Villalonga
ler. > > A very good example is provided by Mark Pilgrim in his 'Dive Into Python'. > Have a look here: > http://www.diveintopython.org/http_web_services/index.html > > Example 11.1 openanything.py > > > Implement your program along those lines. > >

Re: urllib2: handle an error (302)

2007-09-11 Thread Antoni Villalonga
2007/9/11, Lawrence D'Oliveiro: > In message <[EMAIL PROTECTED]>, Antoni > Villalonga wrote: > > > There are any way to handle a 302 error? > > I assume the answer you seek is here > <http://docs.python.org/lib/http-redirect-handler.html>. > -- > http

urllib2: handle an error (302)

2007-09-10 Thread Antoni Villalonga
27;) m = p.search(data) LINK = m.group() LINK = LINK[6:(len(LINK)-1)] if ("http" != LINK[0:4]):#It just sucks LINK = HOST+LINK print "Visit: "+LINK r = opener.open(LINK) data= r.read() #<--- End of code ---> -- "Boring two-person multiplayer may turn friends into enemies." Antoni Villalonga i Noceras #Bloc# ~> http://friki.CAT #Jabber# ~> [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list