# html

## Table of Contents

- [Options](#options)
- [Examples](#examples)

---

Fully rendered HTML, captured after JavaScript runs. It resolves to a string:

```js
consthtml=awaitmicrolink.html('https://example.com')
```

Unlike a plain `fetch`, the markup reflects the DOM after client-side rendering when [prerender](https://microlink.io/docs/api/parameters/prerender) kicks in, so single-page applications return their real content.

## Options

It takes the same scoping options as [markdown](https://microlink.io/docs/sdk/methods/markdown):

- [selector](https://microlink.io/docs/sdk/methods/extract/selector) `<string>` — returns the inner HTML of the first element matching the CSS selector.
- [selectorAll](https://microlink.io/docs/sdk/methods/extract/selectorAll) `<string> | <string[]>` — returns the inner HTML of every matching element, as an array.
- [type](https://microlink.io/docs/sdk/methods/extract/type) `<string>` — overrides how the extracted value is normalized, per the [rules grammar](https://microlink.io/docs/sdk/methods/extract).

Any [shared option](https://microlink.io/docs/sdk/getting-started/options) applies too.

## Examples

Only the main content region:

```js
consthtml=awaitmicrolink.html('https://example.com',{

selector:'main'

})
```

Grab every product card of a listing to parse on your side:

```js
constcards=awaitmicrolink.html('https://example.com/shop',{

selectorAll:'.product-card',

waitForSelector:'.product-card'

})
```

Render a client-side application and inject a stylesheet before capturing the markup:

```js
consthtml=awaitmicrolink.html('https://app.example.com',{

prerender:true,

styles:['.banner { display: none }']

})
```

For the outer HTML of an element, or attributes instead of markup, write the rule yourself with [extract](https://microlink.io/docs/sdk/methods/extract) and `attr: 'outerHTML'`.

See [URL to HTML](https://microlink.io/docs/guides/content-conversion/url-to-html) in the content conversion guide.