Advertisement
Guest User

Untitled

a guest
Mar 20th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. cis = pix.image_search(q='',
  2.                        response_group = 'high_resolution',
  3.                        safesearch = 'true',
  4.                        order = 'latest',)
  5. i=1
  6. myPath="C:\\Users\\Freeware Sys\\Desktop\\pix"
  7.  
  8. while i<10:
  9.     print(cis['hits'][i]['largeImageURL'])
  10.     u =cis['hits'][i]['largeImageURL']
  11.  
  12.     fullfilename = os.path.join(myPath, 'filename.jpg')
  13.  
  14.     print('Downloading file ',i)
  15.     print(fullfilename)
  16.     filename=u.split('/')[-1]
  17.     urllib.request.urlretrieve(u,filename)
  18.     i+=1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement