Dev.to WebDev πŸ›  Dev πŸ‘ 0 πŸ“– 3 min read

Screenshot a list of websites in one go: full page, mobile, or PDF (no cookie pop-ups)

Say you need screenshots of 50 pages: your client's site before a redesign, competitors' pricing pages, or every page of your own app on a phone. Doing it by hand takes an afternoon. Running your own headless browser mea

Say you need screenshots of 50 pages: your client's site before a redesign, competitors' pricing pages, or every page of your own app on a phone. Doing it by hand takes an afternoon. Running your own headless browser means wrangling cookie banners, lazy images and pages that never finish loading.

I built a small tool on Apify that does it from a list of URLs, for $3 per 1,000 screenshots. Here's how to use it.

What it does

Website Screenshot takes a list of URLs and returns one row per page, with a link to its image:

  • PNG, JPEG, WebP or PDF, full page (up to 16,000 pixels tall) or just the first screen,
  • phone, tablet and desktop sizes: iPhone, Android, iPad, laptop and desktop presets, or your own width and pixel density,
  • one element only, by CSS selector, such as a pricing table or a chart,
  • clean shots: the pop-ups of common cookie tools are hidden (nothing is clicked or accepted), ad and tracker domains are blocked, and you can hide any other element,
  • optional dark mode, and an optional scroll first so lazy images further down appear.

Every row also has the page title, the HTTP status and the image size.

Set it up without code

  1. Open the Actor's page and click Try for free. You need an Apify account.
  2. Paste your URLs, one per line. example.com works; https:// is added for you.
  3. Pick the format and the device, and whether you want the full page.
  4. Click Start. The Screenshots tab shows the images; each row's link opens one.
  5. For a daily record, save the input as a task and add a schedule.

Ready-made setups you can copy in one click:

Or call it from Python

from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("strawhat_studio/website-screenshot").call(run_input={
    "urls": ["https://apify.com", "https://www.python.org"],
    "device": "iphone",
    "fullPage": True,
    "format": "jpeg",
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["status"], item["url"], item["screenshotUrl"])

One row looks like this (trimmed):

{
  "url": "https://apify.com/",
  "status": "captured",
  "screenshotUrl": "https://api.apify.com/v2/key-value-stores/aBc123/records/0001-apify-com.png",
  "format": "png",
  "width": 1920,
  "height": 10056,
  "httpStatus": 200,
  "title": "Apify: Marketplace of ready-to-run tools for AI",
  "truncated": false
}

What it costs

$3 per 1,000 screenshots, plus Apify's start fee of $0.00005 per GB of memory per run. Compute is included.

You pay only for real screenshots. Pages that fail, show an error or block the visit still get a row with the reason, and cost nothing. You can cap any run's cost in the settings.

Limits, honestly

  • Sites with bot protection may refuse. It doesn't use proxies, stealth tricks or CAPTCHA solving. In my test of 60 big popular sites, about a third came back blocked (free, with a picture of what the site showed). Smaller sites, docs and your own pages are rarely affected.
  • Public pages only: no logins or cookies.
  • 16,000 pixels tall at most. Longer pages are cut and marked as truncated.
  • Speed: one page at a time per 4 GB of memory. Light pages take a second or two, the heaviest up to a minute.

Feedback

I'm one person building small, focused tools as Strawhat Studio. If something breaks or a feature is missing, open an issue on the Actor's page and I'll usually reply within a day.

πŸ“° Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.