puppeteer/docs/api/puppeteer.frame.goto.md
dependabot[bot] 93e9acc410
chore(deps-dev): Bump the dev-dependencies group with 3 updates (#12101)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nikolay Vitkov <nvitkov@chromium.org>
2024-03-20 15:03:14 +00:00

1.7 KiB

sidebar_label
Frame.goto

Frame.goto() method

Navigates the frame to the given url.

Signature:

class Frame {
  abstract goto(
    url: string,
    options?: GoToOptions
  ): Promise<HTTPResponse | null>;
}

Parameters

Parameter

Type

Description

url

string

URL to navigate the frame to. The URL should include scheme, e.g. https://

options

GoToOptions

(Optional) Options to configure waiting behavior.

**Returns:**

Promise<HTTPResponse | null>

A promise which resolves to the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect.

Exceptions

If:

  • there's an SSL error (e.g. in case of self-signed certificates). - target URL is invalid. - the timeout is exceeded during navigation. - the remote server does not respond or is unreachable. - the main resource failed to load.

This method will not throw an error when any valid HTTP status code is returned by the remote server, including 404 "Not Found" and 500 "Internal Server Error". The status code for such responses can be retrieved by calling HTTPResponse.status().

Remarks

Navigation to about:blank or navigation to the same URL with a different hash will succeed and return null.

:::warning

Headless mode doesn't support navigation to a PDF document. See the upstream issue.

:::