Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › Automation

How to Generate Website Thumbnails for a List of Indian NGO Websites

By Freedom251 Team · · 6 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a browser automation tool such as Playwright to open each NGO’s homepage and save a screenshot. For a consistent directory, keep the URL list and NGO names together, use the same viewport, scale, and image format for every capture, and usually capture the initial viewport rather than the entire page.

Prepare the NGO URL list

Start with reviewed, canonical homepage URLs—not search-result links or temporary redirect URLs. Keep each URL paired with the organization’s name so every image can be identified later. A simple CSV can contain name,url columns.

As an Amazon Associate I earn from qualifying purchases.

The capture loop and file naming are application-level choices: Playwright documents how to navigate to one page and take a screenshot, not a ready-made workflow for NGO directories. The example below applies that documented operation to a list.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose what the thumbnail should show

Initial viewport

A viewport screenshot captures the visible browser area after the page loads. It is usually the more useful choice for a visual directory because each image has a comparable frame. Select dimensions that fit the directory or report layout; there is no universally established thumbnail size.

Full page

A full-page screenshot captures the scrollable page, which can help when reviewing all homepage content but often produces a much taller image than a conventional thumbnail. Playwright supports full-page capture as well as viewport, element, and buffer screenshots. Playwright screenshot guide

Generate thumbnails locally with Playwright

Install Playwright and its Chromium browser, save the following as thumbnails.mjs, and run it with Node.js. The script reads a CSV with a header row, visits each URL, saves one WebP image per site, and records errors without stopping the remaining captures.

  1. npm init -y
  2. npm install playwright
  3. npx playwright install chromium
  4. Create sites.csv with columns name,url, for example: Example NGO,https://example.org.
  5. Save and run the script below using node thumbnails.mjs.
import { chromium } from 'playwright';
import { readFile, mkdir, writeFile } from 'node:fs/promises';

const input = await readFile('sites.csv', 'utf8');
const rows = input.trim().split(/r?n/).slice(1);
const sites = rows.map((line) => {
  const comma = line.indexOf(',');
  if (comma < 0) throw new Error(`Expected name,url row: ${line}`);
  return { name: line.slice(0, comma).trim(), url: line.slice(comma + 1).trim() };
}).filter((site) => site.name && site.url);

const safeName = (name) => name.normalize('NFKD')
  .replace(/[^a-zA-Z0-9_-]+/g, '-').replace(/^-+|-+$/g, '').toLowerCase() || 'site';

await mkdir('thumbnails', { recursive: true });
const browser = await chromium.launch({ headless: true });
const results = [];

for (const [index, site] of sites.entries()) {
  const page = await browser.newPage({ viewport: { width: 1280, height: 800 }, deviceScaleFactor: 1 });
  try {
    const response = await page.goto(site.url, { waitUntil: 'domcontentloaded', timeout: 30000 });
    await page.waitForTimeout(1500);
    const file = `thumbnails/${String(index + 1).padStart(3, '0')}-${safeName(site.name)}.webp`;
    await page.screenshot({ path: file, type: 'webp' });
    results.push({ name: site.name, url: site.url, status: response?.status() ?? null, file, error: null });
    console.log(`Saved ${file}${response ? ` (HTTP ${response.status()})` : ''}`);
  } catch (error) {
    results.push({ name: site.name, url: site.url, status: null, file: null, error: String(error) });
    console.error(`Failed ${site.url}: ${error}`);
  } finally {
    await page.close();
  }
}

await browser.close();
await writeFile('thumbnails/results.json', JSON.stringify(results, null, 2));

The code uses a fixed 1280 × 800 CSS-pixel viewport and device scale factor 1 to keep captures comparable; these are example choices, not a required thumbnail standard. It uses WebP to produce image files; change the screenshot type to png or jpeg if that better suits your publishing workflow. Playwright’s page API documents navigation and screenshot options, including type, scale, and full-page capture. Playwright Page API

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option

The short post-navigation wait is a practical compromise, not proof that every page has finished rendering. Sites that populate content later may need a longer wait or a site-specific readiness condition. Browser rendering can differ from what a person sees because of timing, scripts, redirects, browser errors, or overlays.

Make the output consistent and useful

  • Keep viewport width, height, device scale factor, and output format the same across the URL list.
  • Choose viewport capture for comparable card-style previews; use full-page capture only when the long page itself is the intended preview.
  • Use stable filenames tied to NGO names, and keep the original URL and capture status in a manifest.
  • Review the images before publishing. A screenshot file alone does not establish that the page loaded successfully or shows current content.

Playwright’s screenshot tooling exposes output type and scale, and its MCP documentation also describes target, type, scale, and full-page capture. Playwright MCP screenshot documentation

Handle errors and operational edge cases

Navigation times out

A timeout can result from a slow site, a stalled request, or a page that never reaches the chosen load state. The sample catches the error, logs it, and continues to the next URL. Check the URL manually, then retry with a longer timeout or a different readiness condition if the site is expected to load.

The site redirects or returns an error page

The script records the final response status when navigation returns one. Review redirects and non-success statuses rather than treating every saved image as a valid thumbnail. Confirm the canonical URL and decide whether the resulting destination is appropriate for your list.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Consent dialogs, popups, or dynamic content obscure the page

A local screenshot captures what the browser renders; an overlay may remain visible. Do not assume every Indian NGO website uses the same consent system or behavior. If a specific site is important, inspect the result and decide whether an allowed, site-specific interaction or a different capture method is appropriate.

CSV parsing and file names

The compact example assumes a header row and simple two-column CSV values without quoted commas. For names or URLs containing commas, use a CSV parser rather than splitting lines manually. Sanitized names can also collide, so use the numeric prefix or add a unique identifier if your input list may contain duplicate organization names.

Rank #4
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers

Performance, reliability, and data handling

The example processes sites sequentially. That is easier to debug and avoids launching an unbounded number of browser pages, but large lists take longer. If you add concurrency, keep it bounded and test the effect on your machine and the destination sites; no speed or success rate is established for Indian NGO websites here.

You own browser installation, retries, output storage, and any handling of captured page content when running locally. For a hosted provider, check its current batch limits, pricing, data retention, URL handling, regional behavior, and terms before sending URLs or page content to it. Screenshot API documents a REST interface and batch endpoint, but that documentation alone does not establish service reliability or suitability for a particular NGO list. Screenshot API documentation

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. Its clean-shot workflow accepts consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; these steps can be switched off. It says bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, with response headers indicating the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents and other MCP clients.

For a one-URL smoke test, create a free API key and replace the example URL with a reviewed NGO homepage. The parameter names used by other screenshot APIs also work, which can make migration easier. See the ScreenshotNeo API documentation.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.org -o shot.webp

This call returns a screenshot response for one URL; it does not itself turn a CSV into a batch workflow. ScreenshotNeo also lists bulk capture of up to 100 URLs per call among its options. Free includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Sign up for free.

Frequently Asked Questions

Can I capture the same page as PNG instead of WebP?

Yes. In the Playwright example, change the screenshot option from type: 'webp' to type: 'png' or type: 'jpeg'.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Does the workflow verify that each NGO website is legitimate or current?

No. It captures the URL you supply; review and verify the organization and destination URL separately.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

AutomationNGO websitesPlaywrightWeb developmentwebsite screenshots

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.