Changing the user agent for urllib

Francis Burton F.L.Burton at bio.gla.ac.uk
Thu Dec 26 11:41:13 EST 2002


Oren Tirosh wrote:
> 
> On Wed, Dec 25, 2002 at 04:11:39AM -0800, Fernando wrote:
> > How can I make urllib.openurl() use a different user agent? I can't
> > retrieve data from google with the default one
> 
> urllib.URLopener.version = "Mozilla/4.0 (compatible; Python-urllib)"
> 
> A better option would be to use the Google API:
> http://diveintomark.org/projects/pygoogle/

Am I right in thinking this only covers Google/Web (and not
Google/Groups)?

Recently I thought it would be nice to have a copy of all my
Usenet postings, and that Google/Groups might be the ideal
source. I was going to write a Python program using urllib.

Is this a sensible way of solving the problem, or is there a
more direct solution already available out there?

Francis



More information about the Python-list mailing list