<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: -",
    "macOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WebPage/load(simulatedRequest:responseHTML:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "s:6WebKit0A4PageC4load16simulatedRequest12responseHTMLQr10Foundation10URLRequestV_SStF"
  },
  "title" : "load(simulatedRequest:responseHTML:)"
}
-->

# load(simulatedRequest:responseHTML:)

Loads the web content from the HTML you provide as if the HTML were the response to the request.

```
@discardableResult @MainActor final func load(simulatedRequest request: URLRequest, responseHTML htmlString: String) -> some AsyncSequence<WebPage.NavigationEvent, any Error>
```

## Parameters

`request`

A URL request that specifies the base URL and other loading details the system uses to interpret the HTML you provide.

`htmlString`

The HTML code you provide in a string to use as the contents of the webpage.

## Return Value

An async sequence you use to track the loading progress of the navigation. If the `Task` enclosing the sequence is cancelled, the page will stop loading all resources.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)