Extract & Download Images

Give it a URL, get back every image on the page. Handles product photos, hero images, thumbnails, whatever the page has.

Extract & Download Images demo
TypeScript
Source code
npx create-browser-app --template image-url-download
uvx create-browser-app --template image-url-download

Get started with the Image URL Download template

Point Stagehand at any URL and it extracts every image on the page, <img> tags, background images, all of it. Each image is downloaded through the browser's own connection, so cookies, proxy, and auth come along for free. Works on product catalogs, docs sites, landing pages, or anything behind a login. Files are saved with the correct extension based on the actual MIME type.

Steps

  1. Navigate to the target URL and wait for the page to load

  2. Extract all image URLs from the page with Stagehand

  3. Remove duplicates and limit how many images to download

  4. Download each image through the browser's connection, proxy and cookies included

  5. Save images organized by site with the correct file extension