diff --git a/docs/api.md b/docs/api.md index b9b837d2e1..c6682e0044 100644 --- a/docs/api.md +++ b/docs/api.md @@ -310,6 +310,9 @@ * [coverage.stopCSSCoverage()](#coveragestopcsscoverage) * [coverage.stopJSCoverage()](#coveragestopjscoverage) - [class: TimeoutError](#class-timeouterror) +- [class: Selector](#class-selector) + * [selector.selector](#selectorselector) + * [selector.visible](#selectorvisible) ### Overview @@ -1049,7 +1052,7 @@ Emitted when a request finishes successfully. Emitted when a [response] is received. #### page.$(selector) -- `selector` <[string]> A [selector] to query page for +- `selector` <[string]|[Selector]> A [selector] to query page for - returns: <[Promise]> The method runs `document.querySelector` within the page. If no element matches the selector, the return value resolves to `null`. @@ -1057,7 +1060,7 @@ The method runs `document.querySelector` within the page. If no element matches Shortcut for [page.mainFrame().$(selector)](#frameselector). #### page.$$(selector) -- `selector` <[string]> A [selector] to query page for +- `selector` <[string]|[Selector]> A [selector] to query page for - returns: <[Promise]<[Array]<[ElementHandle]>>> The method runs `document.querySelectorAll` within the page. If no elements match the selector, the return value resolves to `[]`. @@ -1065,7 +1068,7 @@ The method runs `document.querySelectorAll` within the page. If no elements matc Shortcut for [page.mainFrame().$$(selector)](#frameselector-1). #### page.$$eval(selector, pageFunction[, ...args]) -- `selector` <[string]> A [selector] to query page for +- `selector` <[string]|[Selector]> A [selector] to query page for - `pageFunction` <[function]\([Array]<[Element]>\)> Function to be evaluated in browser context - `...args` <...[Serializable]|[JSHandle]> Arguments to pass to `pageFunction` - returns: <[Promise]<[Serializable]>> Promise which resolves to the return value of `pageFunction` @@ -1080,7 +1083,7 @@ const divsCounts = await page.$$eval('div', divs => divs.length); ``` #### page.$eval(selector, pageFunction[, ...args]) -- `selector` <[string]> A [selector] to query page for +- `selector` <[string]|[Selector]> A [selector] to query page for - `pageFunction` <[function]\([Element]\)> Function to be evaluated in browser context - `...args` <...[Serializable]|[JSHandle]> Arguments to pass to `pageFunction` - returns: <[Promise]<[Serializable]>> Promise which resolves to the return value of `pageFunction` @@ -1145,7 +1148,7 @@ Get the browser the page belongs to. Get the browser context that the page belongs to. #### page.click(selector[, options]) -- `selector` <[string]> A [selector] to search for element to click. If there are multiple elements satisfying the selector, the first will be clicked. +- `selector` <[string]|[Selector]> A [selector] to search for element to click. If there are multiple elements satisfying the selector, the first will be clicked. - `options` <[Object]> - `button` <"left"|"right"|"middle"> Defaults to `left`. - `clickCount` <[number]> defaults to 1. See [UIEvent.detail]. @@ -1192,7 +1195,7 @@ Gets the full HTML contents of the page, including the doctype. - returns: <[Coverage]> #### page.dblclick(selector[, options]) -- `selector` <[string]> A [selector] to search for element to double click. If there are multiple elements satisfying the selector, the first will be double clicked. +- `selector` <[string]|[Selector]> A [selector] to search for element to double click. If there are multiple elements satisfying the selector, the first will be double clicked. - `options` <[Object]> - `button` <"left"|"right"|"middle"> Defaults to `left`. - `delay` <[number]> Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0. @@ -1431,7 +1434,7 @@ const fs = require('fs'); ``` #### page.fill(selector, value) -- `selector` <[string]> A [selector] to query page for. +- `selector` <[string]|[Selector]> A [selector] to query page for. - `value` <[string]> Value to fill for the ``, `