Skip to content

A simple library to scrape Pinterest images written in Python

License

Notifications You must be signed in to change notification settings

iamatulsingh/pinscrape

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pinscrape

Logo

built with Python3

This package can be used to scrape images from pinterest just by using any search keywords. Install it just by using

pip install pinscrape

How to use?

from pinscrape import scraper, Pinterest


keyword = "messi"
output_folder = "output"
proxies = {}
number_of_workers = 10
images_to_download = 1

def using_search_engine():
    details = scraper.scrape(keyword, output_folder, proxies, number_of_workers, images_to_download)
    if details["isDownloaded"]:
        print("\nDownloading completed !!")
        print(f"\nTotal urls found: {len(details['extracted_urls'])}")
        print(f"\nTotal images downloaded (including duplicate images): {len(details['urls_list'])}")
        print(details)
    else:
        print("\nNothing to download !!", details)


def using_pinterest_apis():
    p = Pinterest(proxies=proxies) # you can also pass `user_agent` here.
    images_url = p.search(keyword, images_to_download)
    p.download(url_list=images_url, number_of_workers=number_of_workers, output_folder=output_folder)