To select a dropdown option inside an iframe, get the Puppeteer Frame that contains the <select>, then call frame.select(selector, optionValue). The arguments are option values—not the visible labels. For example: await frame.select('select#colors', 'blue').
Find the frame that contains the select
Puppeteer evaluates frame-scoped operations in the receiver frame’s context. A selector run against the main frame will not find a control inside a child iframe. Pages expose their frame tree through page.frames(), and each frame also exposes its child frames.
As an Amazon Associate I earn from qualifying purchases.
For example, locate a frame by a stable URL fragment, then select the option:
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteconst frame = page.frames().find(frame => frame.url().includes('/preferences'));
if (!frame) throw new Error('Preferences frame not found');
const selectedValues = await frame.select('select#colors', 'blue');
console.log(selectedValues);
Use an identity that fits the page, such as a stable URL, frame name, or the associated iframe’s identity. The URL-fragment check above is only an example; avoid relying on a fragment that can change between runs. Puppeteer’s Frame API reference documents frame identity and the frame tree.
#1 Best Overall
Select by option value
Frame.select() takes a CSS selector for a <select> and one or more option values. It acts on the first matching select in that frame, and its returned array contains the values it successfully selected. The current API reference marks this method for Puppeteer 25.12.0; check the reference for the Puppeteer version installed in your project.
const selectedValues = await frame.select('select#colors', 'blue');
If the markup is <option value="blue">Blue</option>, pass 'blue', not 'Blue'. Confirm the option’s actual value when a selection does not behave as expected.
Rank #2
Handle single-select and multiple-select controls
Single-select
Pass the value of the option you want:
await frame.select('select#colors', 'blue');
Multiple-select
For a <select multiple>, pass each desired value as an additional argument:
await frame.select('select#colors', 'red', 'green', 'blue');
Puppeteer considers all supplied values for a multiple-select. If the element is not a multiple-select, only the first supplied value is considered.
Choose between Frame.select and a locator
Use frame.select() when you know the option value and want the direct selection API, including passing several values to a multiple-select. Puppeteer’s interaction guide also recommends locators for common interactions: locators can wait for an element to be present and ready, and Locator.fill() supports select elements.
await frame.locator('select#colors').fill('blue');
A frame locator still runs in the frame it belongs to. Choose the approach based on the interaction you need: direct value selection, especially for multiple values, or locator readiness behavior.
Rank #4
Troubleshoot a selection that fails
- No matching select:
Frame.select()throws if it finds no matching<select>. Check both the selector and that you called it on the frame containing the control. - Wrong frame:
page.select()is shorthand forpage.mainFrame().select(). For an iframe, callselect()on that child frame instead. - Wrong option value: The method accepts option values, not display text. Inspect the page’s markup or the option values and pass the exact value.
- Several selects match: The method acts on the first matching select. Narrow the selector so it identifies the intended control.
- Frame lookup returns nothing: Verify the frame identity against the page’s current frame tree and use a stable URL, name, or iframe identity. Do not assume a control belongs to the main frame.
Or skip the browser setup
If you need a screenshot of the page rather than to change a form control, ScreenshotNeo can return an image or PDF with one GET request. It accepts cookie and consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and billing status. Its MCP server provides screenshot tools for AI agents, including Claude, Cursor, and other MCP clients.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →cURL:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. ScreenshotNeo has a free plan with 1,000 shots per month and no card required; paid plans start at $5 for 3,000 shots. Sign up for 1,000 free screenshots a month, with no card.
For frame selection, however, use Puppeteer’s frame API: a screenshot API captures a page; it does not select a dropdown option.
Frequently Asked Questions
Can I pass the visible option label to Puppeteer’s select method?
Pass the option’s value attribute. The visible label may differ from that value.
Does page.select() work for a dropdown inside an iframe?
No. It operates on the main frame. Use the child Frame containing the dropdown.
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.




