Pinterest Scraper
by @kexu9
Scrapes Pinterest boards, profiles, or search results with infinite scroll, image quality options, deduplication, resume support, and Telegram album sending.
clawhub install pinterest-scraperπ About This Skill
name: pinterest-scraper description: Full-featured Pinterest image scraper with infinite scroll, quality options, Telegram integration, duplicate detection, resume support, and verbose logging. Use when: (1) Scraping Pinterest boards/users/search, (2) Need quality options (originals/736x/474x/236x), (3) Sending images to Telegram, (4) Resuming interrupted scrapes, (5) Avoiding duplicate downloads, (6) Debugging with verbose logs. version: 1.1.0 changelog: "v1.1.0: Added reasoning framework, decision trees, troubleshooting, self-checks" metadata: openclaw: requires: bins: - python3 pip: - playwright - requests emoji: "π" category: "utility" homepage: https://github.com/KeXu9/pinterest-scraper
Pinterest Scraper
Full-featured Pinterest image scraper with automatic scrolling and multiple output options.
When This Skill Activates
This skill triggers when user wants to download images from Pinterest.
Reasoning Framework
| Step | Action | Why | |------|--------|-----| | 1 | EXTRACT | Parse Pinterest URL to determine board/user/search | | 2 | LAUNCH | Start Playwright browser with stealth options | | 3 | SCROLL | Incrementally load images (Pinterest uses infinite scroll) | | 4 | COLLECT | Extract image URLs with quality selection | | 5 | DEDUP | Hash-based duplicate detection | | 6 | DOWNLOAD | Save images to output folder | | 7 | NOTIFY | Optional: send to Telegram |
Setup
pip install playwright requests
playwright install chromium
Decision Tree
What are you trying to do?
βββ Download images from a board/user
β βββ Use: -u "URL" -s [scrolls]
β
βββ Get highest quality possible
β βββ Use: -q originals
β
βββ Get smaller/faster downloads
β βββ Use: -q 736x or 236x
β
βββ Send images to phone
β βββ Use: --telegram --token X --chat Y
β
βββ Resume interrupted scrape
β βββ Use: --resume
β
βββ Debug issues
βββ Use: -v (verbose logging)
Quality Selection Decision
| Quality | Use Case | File Size | |---------|----------|-----------| | originals | Best quality, archiving | Largest | | 736x | Good balance | Medium | | 474x | Thumbnail quality | Small | | 236x | Preview only | Smallest | | all | Save every version | Largest total |
Usage
Command Line
python scrape_pinterest.py -u "URL" [options]
| Option | Description | Default |
|--------|-------------|---------|
| -u, --url | Pinterest URL (required) | - |
| -s, --scrolls | Number of scrolls | 50 |
| -o, --output | Output folder | ./pinterest_output |
| -q, --quality | Quality: originals/736x/474x/236x/all | originals |
| -v, --verbose | Enable verbose logging | false |
| --telegram | Send images to Telegram | false |
| --token | Telegram bot token | - |
| --chat | Telegram chat ID | - |
| --resume | Resume from previous scrape | false |
| --dedup | Skip duplicates | true |
| --no-dedup | Disable deduplication | - |
| --telegram-only | Only send existing files | false |
Common Examples
# Basic scrape (50 scrolls, originals, current dir)
python scrape_pinterest.py -u "URL"Verbose mode (logs to console + scrape.log)
python scrape_pinterest.py -u "URL" -vMore scrolls, custom output, medium quality
python scrape_pinterest.py -u "URL" -s 100 -o ./output -q 736x -vWith Telegram delivery
python scrape_pinterest.py -u "URL" --telegram --token "TOKEN" --chat "CHAT_ID"Resume interrupted scrape
python scrape_pinterest.py -u "URL" --resume -vShow help
python scrape_pinterest.py --help
Python API
This tool is CLI-based. Run it from your Python code:
import subprocess
import osRun the scraper
result = subprocess.run(
['python3', 'scrape_pinterest.py', '-u', 'URL', '-s', '50', '-q', 'originals'],
cwd='./scripts',
capture_output=True,
text=True
)print(result.returncode) # 0 = success
print(result.stdout)
Features
| Feature | Description | |---------|-------------| | Infinite Scroll | Automatic scrolling loads more images | | Quality Options | originals/736x/474x/236x/all | | Telegram | Send directly to Telegram | | Deduplication | Hash-based duplicate detection | | Resume | Continue from previous scrape | | URL Types | Boards, user profiles, search results | | Verbose Logging | -v flag, logs to console + scrape.log |
Verbose Logging
Use -v or --verbose for detailed logging:
python scrape_pinterest.py -u "URL" -v
What gets logged:
Log files:
scrape.log: DEBUG level (detailed)Troubleshooting
Problem: No images downloaded
-s value (try 100-200)Problem: "Browser not found"
playwright install chromiumProblem: SSL certificate errors (Mac)
verify=False in requests callsProblem: Duplicate images
--dedup flag (default: on)Problem: Resume not working
.scrape_state.jsonProblem: Telegram not sending
Problem: Verbose logs not writing
Self-Check
playwright install chromiumNotes
verify=False for requests (Mac SSL issues).scrape_state.json for resumescrape.logQuick Reference
| Task | Command |
|------|---------|
| Basic scrape | python scrape_pinterest.py -u "URL" |
| Verbose debug | python scrape_pinterest.py -u "URL" -v |
| High quality | python scrape_pinterest.py -u "URL" -q originals |
| Fast/small | python scrape_pinterest.py -u "URL" -q 236x |
| Send to Telegram | python scrape_pinterest.py -u "URL" --telegram --token X --chat Y |
| Resume | python scrape_pinterest.py -u "URL" --resume |
| Custom output | python scrape_pinterest.py -u "URL" -o ./myfolder |
π‘ Examples
Command Line
python scrape_pinterest.py -u "URL" [options]
| Option | Description | Default |
|--------|-------------|---------|
| -u, --url | Pinterest URL (required) | - |
| -s, --scrolls | Number of scrolls | 50 |
| -o, --output | Output folder | ./pinterest_output |
| -q, --quality | Quality: originals/736x/474x/236x/all | originals |
| -v, --verbose | Enable verbose logging | false |
| --telegram | Send images to Telegram | false |
| --token | Telegram bot token | - |
| --chat | Telegram chat ID | - |
| --resume | Resume from previous scrape | false |
| --dedup | Skip duplicates | true |
| --no-dedup | Disable deduplication | - |
| --telegram-only | Only send existing files | false |
Common Examples
# Basic scrape (50 scrolls, originals, current dir)
python scrape_pinterest.py -u "URL"Verbose mode (logs to console + scrape.log)
python scrape_pinterest.py -u "URL" -vMore scrolls, custom output, medium quality
python scrape_pinterest.py -u "URL" -s 100 -o ./output -q 736x -vWith Telegram delivery
python scrape_pinterest.py -u "URL" --telegram --token "TOKEN" --chat "CHAT_ID"Resume interrupted scrape
python scrape_pinterest.py -u "URL" --resume -vShow help
python scrape_pinterest.py --help
βοΈ Configuration
pip install playwright requests
playwright install chromium
π Tips & Best Practices
verify=False for requests (Mac SSL issues).scrape_state.json for resumescrape.log