Skip to content

SwatiModi/pinterest-web-scraper

Repository files navigation

pinterest-web-scraper

"Scraping Visually Similar Images from Pinterest"

Meme


Table of Contents

Installation

1. Download the repository

Clone the base repository onto your desktop with git as follows:

$ git clone https://github.com/SwatiModi/pinterest-web-scraper
2. Install necessary dependencies
$ pip install -r requirements.txt
3. Install chrome driver
$ wget https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.zip
$ unzip chromedriver_linux64.zip

$ sudo mv chromedriver /usr/bin/chromedriver
$ sudo chown root:root /usr/bin/chromedriver
$ sudo chmod +x /usr/bin/chromedriver

Usage

I have tried a example on query "mens checked shirt" and pushed the resultant csv and folder here in the repo.

1. Search for some product (eg. Black shoes)
$ python pinterest.py 

or pass the search query category as a argument

$ python pinterest.py --category <search query>

This will create a CSV of URLs to pins for the given search query

Pins' URLS

2. Download the visually similar images
$ python dowload_similar_images.py 

This script reads all the URLs from the CSV created by previous script. For each pin URL, it downloads the visually similar images and saved in respective folders pin-wise.

This will create a hierarchy of folders and images as follows:

Downloaded Images

NOTE:

Web Scraping from many websites is Illegal.
This project is just for Learning and Fun.