BUG URLLIB2

Brian Quinlan brian at sweetapp.com
Fri Nov 15 14:43:52 EST 2002


bart wrote:
> I tested to set them following way:
> 
>       __name__="Mozzilla"
>       __version__="5.0"
>

That is not how you change the user agent. That job is up to an
urllib2.OpenerDirector instance (see urllib2.py#247). I don't know
enough about the urllib2 architecture to suggest a way of using your own
OpenerDirector subclass to change the user agent.

Cheers,
Brian 





More information about the Python-list mailing list