download images with google custom search api
问题 I have used google image api in python to download 20 first image result with the following code: import os import sys import time from urllib import FancyURLopener import urllib2 import simplejson searchTerm = "Cat" # Replace spaces ' ' in search term for '%20' in order to comply with request searchTerm = searchTerm.replace(' ','%20') # Start FancyURLopener with defined version class MyOpener(FancyURLopener): version = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.11) Gecko/20071127