python - download images with google customsearch api -


my question trivial. tried configure customsearch engine download first 10 results of google image. here python script. works except result far 1 of google image same parameter. can tell me miss?

# -*- coding: utf-8 -*- import os import sys urllib import fancyurlopener import urllib2 import simplejson apiclient.discovery import build   class myopener(fancyurlopener):      version = 'mozilla/5.0 (windows; u; windows nt 5.1; it; rv:1.8.1.11) gecko/20071127 firefox/2.0.0.11' myopener = myopener()  service = build("customsearch", "v1",                developerkey="** key **")  res = service.cse().list(     q='searchterm',     cx='** cx**',     searchtype='image',     num=10,     imgtype='photo',     filetype='jpg',     imgsize="xxlarge" ).execute()  count=0 item in res['items']:   myopener.retrieve(item['link'],str(count))   count=count+1 


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

c# - Unity IoC Lifetime per HttpRequest for UserStore -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -