For a native HTML dropdown, await page.select() with the option’s value, wait for any page content that updates asynchronously, then save the screenshot with page.screenshot(). The example below uses Puppeteer 25.12.0; the documented behavior is described in the Page API.
Capture a native dropdown selection
Use page.select(selector, value) for a native <select> element. It selects the matching option and triggers the input and change events. Await the call before taking the screenshot.
As an Amazon Associate I earn from qualifying purchases.
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
await page.goto('https://example.com');
// Use the option's value attribute, not necessarily its visible label.
await page.select('select#country', 'CA');
// Wait for the page's result if selection causes an asynchronous update.
await page.waitForFunction(() =>
document.querySelector('#selected-country')?.textContent?.trim() === 'Canada'
);
await page.screenshot({ path: 'selected.png' });
} finally {
await browser.close();
}
Replace the example URL, selector, option value, and result condition with the ones used by the page you are automating. If changing the dropdown does not trigger an asynchronous update, you can omit the result wait and capture immediately after page.select().
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Wait for the state you want to show
Selection completing does not guarantee that application code has finished updating the page. If the screenshot must show a result, wait for an observable state that represents that result rather than adding an arbitrary delay.
#1 Best Overall
Wait for a result element
If a result element is added after selection, wait for it to appear:
await page.select('select#country', 'CA');
await page.waitForSelector('#result', { visible: true });
await page.screenshot({ path: 'selected.png' });
waitForSelector() can wait for an element to be present and, with visible: true, visible. Its documented default timeout is 30 seconds; see the waitForSelector API.
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
Wait for particular content
If the element already exists but its text changes, wait for the expected value instead:
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteawait page.select('select#country', 'CA');
await page.waitForFunction(() =>
document.querySelector('#selected-country')?.textContent?.trim() === 'Canada'
);
await page.screenshot({ path: 'selected.png' });
This is a pattern, not a guarantee about how any particular site updates. Choose a condition tied to the content you need in the image. Puppeteer documents waitForFunction() for waiting until a page function evaluates truthily. For general interaction, Puppeteer recommends locators, which include automatic precondition checks.
Rank #3
Handle custom dropdowns differently
page.select() is for a real HTML <select>, not every control that looks like a dropdown. A custom menu may be built from buttons, list items, or other elements. Inspect its markup and interact with the actual controls using locators or another appropriate input method.
For a native select, a locator can also fill the selection:
Rank #4
- 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
await page.locator('select#country').fill('CA');
Use the method that matches the page and test. See Puppeteer’s Page API and interaction guide.
Choose the screenshot area
page.screenshot() saves the image and returns a promise. PNG is the default image type. Pick the capture scope according to what the reader needs to see; the available screenshot options are documented in ScreenshotOptions.
Best Value
- Viewport:
await page.screenshot({ path: 'selected.png' });captures the current viewport. - Entire page:
await page.screenshot({ path: 'selected.png', fullPage: true });captures the full page. - Region: use the
clipoption to capture a specified rectangle. - One element: capture that element with
ElementHandle.screenshot(); Puppeteer’s guide notes that it scrolls the element into view if needed.
The official Screenshots guide recommends Page.screenshot() for page captures and documents element screenshots.
Common failures and fixes
- The select does not change: confirm the selector matches a native
<select>and thatCAis the option’s actualvalue, not just its displayed text. Use the page’s real option value. - The screenshot shows the old result: await the selection call, then wait for a result-specific condition such as changed text or a visible result element.
- The selector wait times out: check that the target selector exists and that the condition can become true after this selection. A wait is only useful when it represents a state the page actually reaches.
page.select()cannot operate on the menu: the control may be custom markup rather than a native select. Interact with the menu’s actual buttons or options instead.- The output misses content: determine whether you need the viewport, the full page, a clipped region, or an element-only image, and choose the corresponding screenshot method.
- The script exits before the image is saved: await
page.screenshot()and keep the browser open until it completes; the example closes the browser in afinallyblock so it also closes after an error.
Or skip the browser setup
ScreenshotNeo can capture a URL with one GET request; the parameters used by other screenshot APIs also work, which can make switching easier. Create an API key and see the ScreenshotNeo documentation.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
ScreenshotNeo removes cookie and consent banners, newsletter popups, and chat widgets before capture. Bot checks, blank pages, failed loads, timeouts, and cache hits cost nothing; response headers report the page verdict and billing status. Its MCP server offers screenshot tools for AI agents, and the free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. For dropdown-driven pages, use the browser method above when you need to perform page interactions before capture; ScreenshotNeo is a direct URL capture API.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Sign up for 1,000 free screenshots a month, with no card.
Quick Recap
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.




