A simple Pinterest image scraper
Project description
Pinterest Scraper
A powerful Python tool to scrape and download images from Pinterest using Playwright. This tool extracts image URLs from any Pinterest board and downloads them concurrently with multi-threading, offering both headless and standard browser modes.
Features
- Image Scraping: Extract image URLs from any Pinterest board.
- Concurrent Downloads: Download images efficiently using multi-threading.
- Command-Line Interface (CLI): Simple and user-friendly CLI for quick operations.
- Headless Mode: Option to run in headless mode for faster, resource-efficient scraping.
- Modular Design: Well-organized code structure for easy customization and extension.
Installation
Prerequisites
- Python 3.6+
- Google Chrome or Chromium installed
- Playwright dependencies installed
Steps
-
Clone the repository:
git clone https://github.com/Jarvis-Mi/-Pinterest-Image-Scraper.git cd pinterest_scraper
-
Install dependencies:
pip install -e . playwright install
Usage
Run the scraper using:
Run the scraper using:
pinterest-scraper <username> <tag> <num_images> [--headless]
Arguments:
- : Pinterest username or profile name.
- : Tag or board name.
- <num_images>: Number of images to download.
- [--headless]: (Optional) Run the browser in headless mode.
Example:
pinterest-scraper exampleuser travel 20 --headless
This command scrapes and downloads 20 images from the "travel" board of user "exampleuser" in headless mode.
Now that your package has been successfully installed, you can test it by installing it using pip and running a simple script to verify that it works.
Usage
Install the package:
pip install auto-pi-download
Test the package:
Once installed, you can test the package by writing a simple script. The package includes a module to download Pinterest images (based on the package name), you can use the following sample code to test it:
from pinterest_scraper import get_image_urls, download_images
# Example usage
pinterest_url = "https://www.pinterest.com/exampleuser/board/"
num_images = 10
img_urls = get_image_urls(pinterest_url, num_images=num_images)
if not img_urls:
print("No images found.")
else:
print(f"Found {len(img_urls)} images.")
download_images(img_urls, "exampleuser")
print("Download completed.")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file auto_pi_download-0.5.tar.gz.
File metadata
- Download URL: auto_pi_download-0.5.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d2896a7dff0a5a9fea7cf4b5378012a7ae74287275015eaa5a4e241af0098ad
|
|
| MD5 |
f9d611c643807cdc06358e50ac2d6307
|
|
| BLAKE2b-256 |
fe6ed9bf5cf08c2f3c6a5da4ce82243a0fd50896e0a9dbea696c6ec9096fd2e0
|
File details
Details for the file auto_pi_download-0.5-py3-none-any.whl.
File metadata
- Download URL: auto_pi_download-0.5-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a1e47cf77fce681bc233710f7de7716310a6e6963ac0d50616fb1fd4b7fc555
|
|
| MD5 |
b52a7376f5e5e1a2d760d3e71b56642b
|
|
| BLAKE2b-256 |
22d1d7a4c14fdfe983b294668d3e938e48ad56f35c92ceb4e7e9cb1e54d1a41f
|