2022-07-05 13:41:43 +00:00
---
sidebar_label: Page.goto
---
# Page.goto() method
2024-05-29 09:14:12 +00:00
Navigates the frame or page to the given `url` .
2023-09-18 12:14:06 +00:00
2022-10-24 07:07:05 +00:00
#### Signature:
2022-07-05 13:41:43 +00:00
```typescript
class Page {
2023-09-18 12:14:06 +00:00
goto(url: string, options?: GoToOptions): Promise< HTTPResponse | null > ;
2022-07-05 13:41:43 +00:00
}
```
## Parameters
2024-03-20 15:03:14 +00:00
< table > < thead > < tr > < th >
2022-07-05 13:41:43 +00:00
2024-03-20 15:03:14 +00:00
Parameter
< / th > < th >
Type
< / th > < th >
Description
< / th > < / tr > < / thead >
< tbody > < tr > < td >
url
< / td > < td >
string
< / td > < td >
2024-05-29 09:14:12 +00:00
URL to navigate the frame to. The URL should include scheme, e.g. `https://`
2024-03-20 15:03:14 +00:00
< / td > < / tr >
< tr > < td >
options
< / td > < td >
[GoToOptions ](./puppeteer.gotooptions.md )
< / td > < td >
_(Optional)_ Options to configure waiting behavior.
< / td > < / tr >
< / tbody > < / table >
2022-07-05 13:41:43 +00:00
**Returns:**
Promise< [HTTPResponse](./puppeteer.httpresponse.md) \| null>
2023-09-18 12:14:06 +00:00
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.
2022-07-05 13:41:43 +00:00
2023-09-18 12:14:06 +00:00
## Remarks
2022-08-12 12:15:26 +00:00
2023-09-18 12:14:06 +00:00
Navigation to `about:blank` or navigation to the same URL with a different hash will succeed and return `null` .
2022-07-05 13:41:43 +00:00
2023-09-18 12:14:06 +00:00
:::warning
2022-07-05 13:41:43 +00:00
2024-05-29 09:14:12 +00:00
Headless shell mode doesn't support navigation to a PDF document. See the [upstream issue ](https://crbug.com/761295 ).
2022-07-05 13:41:43 +00:00
2023-09-18 12:14:06 +00:00
:::
2022-07-05 13:41:43 +00:00
2024-05-29 09:14:12 +00:00
In headless shell, 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() ](./puppeteer.httpresponse.status.md ).