ThomasDotCodes / pinterest-image-scraper

Takes the URL to a Pinterest board and returns a List of all of the image URLs on that board.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pinterest Image Scraper

Now you can take the URL to any Pinterest board (or a CSV of a bunch of boards) and return a Python list of the URLs to the hi-rez versions of all of the images on the board.

Requirements:

  • Python 3.5+ (Anaconda recommended)
  • Pandas (pip install pandas or conda install pandas)
  • Firefox + Gecko driver (Firefox can be omitted if you know what you're doing and have another browser set up to be used via Selenium)
  • Selenium (pip install selenium or conda install -c conda-forge selenium, then see these instructions for installing the Gecko driver if not installing it from Conda)
  • Alternatively, install the Gecko driver using conda: conda install -c conda-forge geckodriver
  • If you want to use Chrome or PhantomJS, install their respective selenium drivers: conda install python-chromedriver-binary phantomjs
  • A Pinterest Account

How to Run:

git clone https://github.com/xjdeng/pinterest-image-scraper.git
cd pinterest-image-scraper
pip install -U .
cd ..
python
from pinterest_scraper import scraper as s
from selenium import webdriver
chrome = webdriver.Chrome()
ph = s.Pinterest_Helper("user@domain.com", "password", chrome)
images = ph.runme("http://URL-to-image-board")

Or if you have a CSV file with a URL to a different image board on every line:

images = ph.getURLs(imageboards.csv)

Now if you want to download these images:

s.download(images, "/path/to/your/destination/dir")

or to download to your current directory:

s.download(images)

About

Takes the URL to a Pinterest board and returns a List of all of the image URLs on that board.


Languages

Language:Python 100.0%