diff --git a/new-docs/puppeteer.frame._.md b/new-docs/puppeteer.frame._.md index 7cc28118145..310a73ec135 100644 --- a/new-docs/puppeteer.frame._.md +++ b/new-docs/puppeteer.frame._.md @@ -4,6 +4,8 @@ ## Frame.$() method +This method queries the frame for the given selector. + Signature: ```typescript @@ -14,9 +16,11 @@ $(selector: string): Promise; | Parameter | Type | Description | | --- | --- | --- | -| selector | string | | +| selector | string | a selector to query for. | Returns: Promise<[ElementHandle](./puppeteer.elementhandle.md) \| null> +A promise which resolves to an `ElementHandle` pointing at the element, or `null` if it was not found. + diff --git a/new-docs/puppeteer.frame.__.md b/new-docs/puppeteer.frame.__.md index 85377779fe8..5b1bd125da4 100644 --- a/new-docs/puppeteer.frame.__.md +++ b/new-docs/puppeteer.frame.__.md @@ -4,6 +4,8 @@ ## Frame.$$() method +This runs `document.querySelectorAll` in the frame and returns the result. + Signature: ```typescript @@ -14,9 +16,11 @@ $$(selector: string): Promise; | Parameter | Type | Description | | --- | --- | --- | -| selector | string | | +| selector | string | a selector to search for | Returns: Promise<[ElementHandle](./puppeteer.elementhandle.md)\[\]> +An array of element handles pointing to the found frame elements. + diff --git a/new-docs/puppeteer.frame.__eval.md b/new-docs/puppeteer.frame.__eval.md index f441635cca2..cc2f0fd7075 100644 --- a/new-docs/puppeteer.frame.__eval.md +++ b/new-docs/puppeteer.frame.__eval.md @@ -14,11 +14,25 @@ $$eval(selector: string, pageFunction: (elements: Element[], ...args | Parameter | Type | Description | | --- | --- | --- | -| selector | string | | -| pageFunction | (elements: Element\[\], ...args: unknown\[\]) => ReturnType \| Promise<ReturnType> | | -| args | [SerializableOrJSHandle](./puppeteer.serializableorjshandle.md)\[\] | | +| selector | string | the selector to query for | +| pageFunction | (elements: Element\[\], ...args: unknown\[\]) => ReturnType \| Promise<ReturnType> | the function to be evaluated in the frame's context | +| args | [SerializableOrJSHandle](./puppeteer.serializableorjshandle.md)\[\] | additional arguments to pass to pageFuncton | Returns: Promise<[WrapElementHandle](./puppeteer.wrapelementhandle.md)<ReturnType>> +## Remarks + +This method runs `Array.from(document.querySelectorAll(selector))` within the frame and passes it as the first argument to `pageFunction`. + +If `pageFunction` returns a Promise, then `frame.$$eval` would wait for the promise to resolve and return its value. + +## Example + + +```js +const divsCounts = await frame.$$eval('div', divs => divs.length); + +``` + diff --git a/new-docs/puppeteer.frame._detach.md b/new-docs/puppeteer.frame._detach.md deleted file mode 100644 index 847829c5c0c..00000000000 --- a/new-docs/puppeteer.frame._detach.md +++ /dev/null @@ -1,15 +0,0 @@ - - -[Home](./index.md) > [puppeteer](./puppeteer.md) > [Frame](./puppeteer.frame.md) > [\_detach](./puppeteer.frame._detach.md) - -## Frame.\_detach() method - -Signature: - -```typescript -_detach(): void; -``` -Returns: - -void - diff --git a/new-docs/puppeteer.frame._eval.md b/new-docs/puppeteer.frame._eval.md index ee1654dd793..b936609b1c9 100644 --- a/new-docs/puppeteer.frame._eval.md +++ b/new-docs/puppeteer.frame._eval.md @@ -14,11 +14,25 @@ $eval(selector: string, pageFunction: (element: Element, ...args: un | Parameter | Type | Description | | --- | --- | --- | -| selector | string | | -| pageFunction | (element: Element, ...args: unknown\[\]) => ReturnType \| Promise<ReturnType> | | -| args | [SerializableOrJSHandle](./puppeteer.serializableorjshandle.md)\[\] | | +| selector | string | the selector to query for | +| pageFunction | (element: Element, ...args: unknown\[\]) => ReturnType \| Promise<ReturnType> | the function to be evaluated in the frame's context | +| args | [SerializableOrJSHandle](./puppeteer.serializableorjshandle.md)\[\] | additional arguments to pass to pageFuncton | Returns: Promise<[WrapElementHandle](./puppeteer.wrapelementhandle.md)<ReturnType>> +## Remarks + +This method runs `document.querySelector` within the frame and passes it as the first argument to `pageFunction`. + +If `pageFunction` returns a Promise, then `frame.$eval` would wait for the promise to resolve and return its value. + +## Example + + +```js +const searchValue = await frame.$eval('#search', el => el.value); + +``` + diff --git a/new-docs/puppeteer.frame._navigated.md b/new-docs/puppeteer.frame._navigated.md deleted file mode 100644 index 52aca09a989..00000000000 --- a/new-docs/puppeteer.frame._navigated.md +++ /dev/null @@ -1,22 +0,0 @@ - - -[Home](./index.md) > [puppeteer](./puppeteer.md) > [Frame](./puppeteer.frame.md) > [\_navigated](./puppeteer.frame._navigated.md) - -## Frame.\_navigated() method - -Signature: - -```typescript -_navigated(framePayload: Protocol.Page.Frame): void; -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| framePayload | Protocol.Page.Frame | | - -Returns: - -void - diff --git a/new-docs/puppeteer.frame._navigatedwithindocument.md b/new-docs/puppeteer.frame._navigatedwithindocument.md deleted file mode 100644 index 8274974a5cb..00000000000 --- a/new-docs/puppeteer.frame._navigatedwithindocument.md +++ /dev/null @@ -1,22 +0,0 @@ - - -[Home](./index.md) > [puppeteer](./puppeteer.md) > [Frame](./puppeteer.frame.md) > [\_navigatedWithinDocument](./puppeteer.frame._navigatedwithindocument.md) - -## Frame.\_navigatedWithinDocument() method - -Signature: - -```typescript -_navigatedWithinDocument(url: string): void; -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| url | string | | - -Returns: - -void - diff --git a/new-docs/puppeteer.frame._onlifecycleevent.md b/new-docs/puppeteer.frame._onlifecycleevent.md deleted file mode 100644 index ead82321172..00000000000 --- a/new-docs/puppeteer.frame._onlifecycleevent.md +++ /dev/null @@ -1,23 +0,0 @@ - - -[Home](./index.md) > [puppeteer](./puppeteer.md) > [Frame](./puppeteer.frame.md) > [\_onLifecycleEvent](./puppeteer.frame._onlifecycleevent.md) - -## Frame.\_onLifecycleEvent() method - -Signature: - -```typescript -_onLifecycleEvent(loaderId: string, name: string): void; -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| loaderId | string | | -| name | string | | - -Returns: - -void - diff --git a/new-docs/puppeteer.frame._onloadingstopped.md b/new-docs/puppeteer.frame._onloadingstopped.md deleted file mode 100644 index f5db1400a76..00000000000 --- a/new-docs/puppeteer.frame._onloadingstopped.md +++ /dev/null @@ -1,15 +0,0 @@ - - -[Home](./index.md) > [puppeteer](./puppeteer.md) > [Frame](./puppeteer.frame.md) > [\_onLoadingStopped](./puppeteer.frame._onloadingstopped.md) - -## Frame.\_onLoadingStopped() method - -Signature: - -```typescript -_onLoadingStopped(): void; -``` -Returns: - -void - diff --git a/new-docs/puppeteer.frame._x.md b/new-docs/puppeteer.frame._x.md index dded77cc4a7..169ff74f77f 100644 --- a/new-docs/puppeteer.frame._x.md +++ b/new-docs/puppeteer.frame._x.md @@ -4,6 +4,8 @@ ## Frame.$x() method +This method evaluates the given XPath expression and returns the results. + Signature: ```typescript @@ -14,7 +16,7 @@ $x(expression: string): Promise; | Parameter | Type | Description | | --- | --- | --- | -| expression | string | | +| expression | string | the XPath expression to evaluate. | Returns: diff --git a/new-docs/puppeteer.frame.addscripttag.md b/new-docs/puppeteer.frame.addscripttag.md index f1fe45de1d0..9aa7cf609aa 100644 --- a/new-docs/puppeteer.frame.addscripttag.md +++ b/new-docs/puppeteer.frame.addscripttag.md @@ -4,24 +4,23 @@ ## Frame.addScriptTag() method +Adds a `