<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSAttributedString/loadFromHTML(request:options:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSAttributedString(cm)loadFromHTMLWithRequest:options:completionHandler:"
  },
  "title" : "loadFromHTML(request:options:completionHandler:)"
}
-->

# loadFromHTML(request:options:completionHandler:)

Creates an attributed string by converting the contents of the specified HTML URL request.

```
class func loadFromHTML(request: URLRequest, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:], completionHandler: @escaping @Sendable (NSAttributedString?, [NSAttributedString.DocumentAttributeKey : Any]?, (any Error)?) -> Void)
```

## Parameters

`request`

A request to fetch an HTML document.

`options`

Specifies additional options for loading the document. For a list of possible keys, see <doc://com.apple.documentation/documentation/UIKit/NSAttributedStringDocumentReadingOptionKey>.

`completionHandler`

A completion handler to execute with the results.

---

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)