You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -845,15 +845,15 @@ Emitted when a dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/We
845
845
-`selector` <[string]> A selector to query page for
846
846
- returns: <[Promise]<?[ElementHandle]>>
847
847
848
-
The method runs `document.querySelector`within the page. If no element matches the selector, the return value resolves to `null`.
848
+
The method finds an element matching the specified selector within the page. See [Working with selectors](#working-with-selectors) for more details. If no elements match the selector, the return value resolves to `null`.
849
849
850
850
Shortcut for [page.mainFrame().$(selector)](#frameselector).
851
851
852
852
#### page.$$(selector)
853
853
-`selector` <[string]> A selector to query page for
854
854
- returns: <[Promise]<[Array]<[ElementHandle]>>>
855
855
856
-
The method runs `document.querySelectorAll`within the page. If no elements match the selector, the return value resolves to `[]`.
856
+
The method finds all elements matching the specified selector within the page. See [Working with selectors](#working-with-selectors) for more details. If no elements match the selector, the return value resolves to `[]`.
857
857
858
858
Shortcut for [page.mainFrame().$$(selector)](#frameselector-1).
859
859
@@ -863,7 +863,7 @@ Shortcut for [page.mainFrame().$$(selector)](#frameselector-1).
863
863
-`arg` <[Serializable]|[JSHandle]> Optional argument to pass to `pageFunction`
864
864
- returns: <[Promise]<[Serializable]>> Promise which resolves to the return value of `pageFunction`
865
865
866
-
This method runs `document.querySelector`within the page and passes it as the first argument to `pageFunction`. If there's no element matching `selector`, the method throws an error.
866
+
The method finds an element matching the specified selector within the page and passes it as a first argument to `pageFunction`. See [Working with selectors](#working-with-selectors) for more details. If no elements match the selector, the method throws an error.
867
867
868
868
If `pageFunction` returns a [Promise], then `page.$eval` would wait for the promise to resolve and return its value.
869
869
@@ -882,7 +882,7 @@ Shortcut for [page.mainFrame().$eval(selector, pageFunction)](#frameevalselector
882
882
-`arg` <[Serializable]|[JSHandle]> Optional argument to pass to `pageFunction`
883
883
- returns: <[Promise]<[Serializable]>> Promise which resolves to the return value of `pageFunction`
884
884
885
-
This method runs `Array.from(document.querySelectorAll(selector))` within the page and passes it as the first argument to `pageFunction`.
885
+
The method finds all elements matching the specified selector within the page and passes an array of matched elements as a first argument to `pageFunction`. See [Working with selectors](#working-with-selectors) for more details.
886
886
887
887
If `pageFunction` returns a [Promise], then `page.$$eval` would wait for the promise to resolve and return its value.
888
888
@@ -1941,21 +1941,21 @@ An example of getting text from an iframe element:
1941
1941
-`selector` <[string]> A selector to query frame for
1942
1942
- returns: <[Promise]<?[ElementHandle]>> Promise which resolves to ElementHandle pointing to the frame element.
1943
1943
1944
-
The method queries frame for the selector. If there's no such element within the frame, the method will resolve to `null`.
1944
+
The method finds an element matching the specified selector within the frame. See [Working with selectors](#working-with-selectors) for more details. If no elements match the selector, the return value resolves to `null`.
1945
1945
1946
1946
#### frame.$$(selector)
1947
1947
-`selector` <[string]> A selector to query frame for
1948
1948
- returns: <[Promise]<[Array]<[ElementHandle]>>> Promise which resolves to ElementHandles pointing to the frame elements.
1949
1949
1950
-
The method runs `document.querySelectorAll`within the frame. If no elements match the selector, the return value resolves to `[]`.
1950
+
The method finds all elements matching the specified selector within the frame. See [Working with selectors](#working-with-selectors) for more details. If no elements match the selector, the return value resolves to `[]`.
1951
1951
1952
1952
#### frame.$eval(selector, pageFunction[, arg])
1953
1953
-`selector` <[string]> A selector to query frame for
1954
1954
-`pageFunction` <[function]\([Element]\)> Function to be evaluated in browser context
1955
1955
-`arg` <[Serializable]|[JSHandle]> Optional argument to pass to `pageFunction`
1956
1956
- returns: <[Promise]<[Serializable]>> Promise which resolves to the return value of `pageFunction`
1957
1957
1958
-
This method runs `document.querySelector`within the frame and passes it as the first argument to `pageFunction`. If there's no element matching `selector`, the method throws an error.
1958
+
The method finds an element matching the specified selector within the frame and passes it as a first argument to `pageFunction`. See [Working with selectors](#working-with-selectors) for more details. If no elements match the selector, the method throws an error.
1959
1959
1960
1960
If `pageFunction` returns a [Promise], then `frame.$eval` would wait for the promise to resolve and return its value.
1961
1961
@@ -1972,7 +1972,7 @@ const html = await frame.$eval('.main-container', (e, suffix) => e.outerHTML + s
1972
1972
-`arg` <[Serializable]|[JSHandle]> Optional argument to pass to `pageFunction`
1973
1973
- returns: <[Promise]<[Serializable]>> Promise which resolves to the return value of `pageFunction`
1974
1974
1975
-
This method runs `Array.from(document.querySelectorAll(selector))` within the frame and passes it as the first argument to `pageFunction`.
1975
+
The method finds all elements matching the specified selector within the frame and passes an array of matched elements as a first argument to `pageFunction`. See [Working with selectors](#working-with-selectors) for more details.
1976
1976
1977
1977
If `pageFunction` returns a [Promise], then `frame.$$eval` would wait for the promise to resolve and return its value.
1978
1978
@@ -2538,21 +2538,21 @@ ElementHandle instances can be used as an argument in [`page.$eval()`](#pageeval
2538
2538
-`selector` <[string]> A selector to query element for
2539
2539
- returns: <[Promise]<?[ElementHandle]>>
2540
2540
2541
-
The method runs `element.querySelector` within the page. If no element matches the selector, the return value resolves to `null`.
2541
+
The method finds an element matching the specified selector in the `ElementHandle`'s subtree. See [Working with selectors](#working-with-selectors) for more details. If no elements match the selector, the return value resolves to `null`.
2542
2542
2543
2543
#### elementHandle.$$(selector)
2544
2544
-`selector` <[string]> A selector to query element for
2545
2545
- returns: <[Promise]<[Array]<[ElementHandle]>>>
2546
2546
2547
-
The method runs `element.querySelectorAll` within the page. If no elements match the selector, the return value resolves to `[]`.
2547
+
The method finds all elements matching the specified selector in the `ElementHandle`s subtree. See [Working with selectors](#working-with-selectors) for more details. If no elements match the selector, the return value resolves to `[]`.
-`selector` <[string]> A selector to query page for
2551
2551
-`pageFunction` <[function]\([Element]\)> Function to be evaluated in browser context
2552
2552
-`arg` <[Serializable]|[JSHandle]> Optional argument to pass to `pageFunction`
2553
2553
- returns: <[Promise]<[Serializable]>> Promise which resolves to the return value of `pageFunction`
2554
2554
2555
-
This method runs `document.querySelector` within the element and passes it as the first argument to `pageFunction`. If there's no element matching `selector`, the method throws an error.
2555
+
The method finds an element matching the specified selector in the `ElementHandle`s subtree and passes it as a first argument to `pageFunction`. See [Working with selectors](#working-with-selectors) for more details. If no elements match the selector, the method throws an error.
2556
2556
2557
2557
If `pageFunction` returns a [Promise], then `frame.$eval` would wait for the promise to resolve and return its value.
-`arg` <[Serializable]|[JSHandle]> Optional argument to pass to `pageFunction`
2570
2570
- returns: <[Promise]<[Serializable]>> Promise which resolves to the return value of `pageFunction`
2571
2571
2572
-
This method runs `document.querySelectorAll` within the element and passes it as the first argument to `pageFunction`. If there's no element matching `selector`, the method throws an error.
2572
+
The method finds all elements matching the specified selector in the `ElementHandle`'s subtree and passes an array of matched elements as a first argument to `pageFunction`. See [Working with selectors](#working-with-selectors) for more details.
2573
2573
2574
2574
If `pageFunction` returns a [Promise], then `frame.$$eval` would wait for the promise to resolve and return its value.
0 commit comments