pinterest-web-scraper
pinterest-web-scraper copied to clipboard
Scraping Visually Similar Images from Pinterest
pinterest-web-scraper
"Scraping Visually Similar Images from Pinterest"
Table of Contents
- Installation
- Usage
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
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:
NOTE:
Web Scraping from many websites is Illegal.
This project is just for Learning and Fun.