Scratch that, the code is simpler. Serves me right for not checking
things twice:
import urllib,urllib2
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor())
request =
urllib2.Request('http://books.google.com/books?bibkeys=0618379436&jscmd=
viewapi&callback=mycallback')
opener.addheaders = [('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT
5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')]
data = opener.open(request).read()
print data
Mike Beccaria
Systems Librarian
Head of Digital Initiatives
Paul Smith's College
518.327.6376
[log in to unmask]
|