1

I'm very new to Python and I'm trying to create a tool that automates downloading images off Google.

So far, I have the following code:

import urllib

def google_image(x):
    search = x.split()
    search = '%20'.join(map(str, search))
    url = 'http://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=%s&safe=off' % 

But I'm not sure where to continue or if I'm even on the right track. Can someone please help?

Bibhas Debnath
  • 14,559
  • 17
  • 68
  • 96
user3105664
  • 179
  • 3
  • 6
  • 11

1 Answers1

1

see scrapy documentation for image pipeline

ITEM_PIPELINES = {'scrapy.contrib.pipeline.images.ImagesPipeline': 1}
Guy Gavriely
  • 11,228
  • 6
  • 27
  • 42
  • So I have to install Scrapy but then what? – user3105664 Jan 23 '14 at 20:23
  • by the tags of your questions I thought you already did, I'll update my answer – Guy Gavriely Jan 23 '14 at 20:24
  • Thank you, I really appreciate it. Relatively new to Python and programming as a whole, and I'm trying to write the code to download the images of a certain search off Google. – user3105664 Jan 23 '14 at 20:26
  • you'll have to download and install scrapy and maybe go over scrapy tutorial to understand how to build a spider http://doc.scrapy.org/en/latest/intro/tutorial.html – Guy Gavriely Jan 23 '14 at 20:26
  • Is there a way to do this without using Scrapy? – user3105664 Jan 23 '14 at 20:28
  • Preferably I'm just trying to recycle code, not necessarily developing my own. All of the code I'm trying doesn't seem to work the way I want it to. Do you have any ideas? I just need a quick batch of code to do what I want it to do. – user3105664 Jan 23 '14 at 20:40