# Wait For Url Load

Source: https://docs.scrappey.com/docs/wait-for-url-load

> Pause browser execution until a specific URL substring is loaded, ensuring the page transition has completed before continuing with other browser actions.

## Command

`"waitForUrl"`

Uses `.includes()` to check if the current URL contains the given substring. This does not return the response body — it only ensures the page has transitioned.

## Parameters

| Parameter    | Type   | Required | Description                                                               |
| ------------ | ------ | -------- | ------------------------------------------------------------------------- |
| `url`        | string | Yes      | The starting URL to navigate to.                                          |
| `waitForUrl` | string | Yes      | Substring to wait for in the destination URL before continuing execution. |

## Example

```bash
curl -X POST "https://publisher.scrappey.com/api/v1?key=YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "cmd": "request.get",
    "url": "https://www.mcmaster.com/products/screws/socket-head-screws~/alloy-steel-socket-head-screws-8/",
    "waitForUrl": "/Content/Explanations.aspx?"
  }'
```

## Notes

Best suited for:

* Websites that redirect or dynamically change the URL after certain actions.
* Ensuring the next page has loaded before executing further browser actions.
* Waiting for final navigation steps before data scraping or input.

Using `waitForUrl` guarantees your scraping workflow proceeds only after the target page has been fully navigated to.
