[Tutor] auto referer handler/opener for urlib2?
xboxmuncher at gmail.com
Tue Oct 21 06:05:03 CEST 2008
I was reading about urllib2 openers.. Can I make any kind of def or function
and make the urllib2 "urlopen" function run through this function first
before opening a url? For example, something like a reporthook function.
What I want to do is this:
if handle.lastRequest.url != None:
handle.addheader('referer' : handle.lastRequest.url)
How can make this auto referer functionality with urllib2?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor