Automatically scrape and download wallpapers from the Bluepoch website using Playwright CLI. The tool opens a real browser, clicks through pagination, scrolls lazy-loaded content, opens thumbnail previews for high-resolution versions, and downloads all discovered images to a local directory.
- Full page traversal — auto-clicks pagination, scrolls through sections, and expands thumbnails to find high-res images
- Multi-source extraction — collects image URLs from DOM elements (
<img>,data-src,background-image,<picture>,<link preload>) and captured network requests - Smart deduplication — filters out UI icons, SVGs, and duplicate URLs
- Authenticated downloads — reuses browser cookies so gated images download correctly
- Batch downloading — downloads images in parallel batches of 4
- Node.js (v18+)
- Playwright CLI installed globally:
npm install -g @playwright/cli
npx playwright-cli installnpm installRun the scraper:
npm run save-wallpapersThe script will:
- Launch a persistent, headed browser session
- Navigate to the wallpaper page and run image discovery (may take a few minutes)
- Download all unique wallpapers into the
images/directory - Print a summary with download counts and total size on disk
Downloaded images are saved under ./images/.
├── src/
│ ├── config.ts # .env configuration & constants
│ ├── download.ts # HTTP download, cookie extraction, URL utilities
│ ├── scraper.ts # Browser script generation & network URL extraction
│ └── main.ts # Orchestration & summary
├── images/ # Output directory for downloaded wallpapers
├── package.json
└── tsconfig.json
- Opens the target page in a persistent Playwright browser session
- Runs an in-browser script that clicks through pagination, scrolls sections, and opens thumbnail previews to collect high-resolution image URLs
- Extracts additional image URLs from recorded network requests
- Merges, deduplicates, and filters out non-wallpaper images (icons, UI sprites)
- Downloads each image using the browser's cookies and a realistic user agent header