Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Go to Latest
method Page.prototype.select
import { Page } from "https://deno.land/x/puppeteer@14.1.1/vendor/puppeteer-core/puppeteer/common/Page.js";

Triggers a change and input event once all the provided options have been selected. If there's no <select> element matching selector, the method throws an error.

Examples

Example 1

page.select('select#colors', 'blue'); // single selection
page.select('select#colors', 'red', 'green', 'blue'); // multiple selections

Parameters

selector: string
...values: string[]
  • Values of options to select. If the <select> has the multiple attribute, all values are considered, otherwise only the first one is taken into account.

Returns

Promise<string[]>