Skip to content

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

Notifications You must be signed in to change notification settings

xjdeng/pinterest-image-scraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
ph = s.Pinterest_Helper(<Pinterst login> , <Pinterest password>)
images = ph.runme("https://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)

Note: you no longer need Firefox. If you'd like to use a different browser (i.e. Chrome or PhantomJS), you'll need to initialize it through selenium, then pass it through the Pinterest_Helper object. For example, using Chrome:

from selenium import webdriver
chrome = webdriver.Chrome()
ph = s.Pinterest_Helper(<Pinterst login> , <Pinterest password>, chrome)

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages