> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# Get Website HTML

- Component: `appmixer.piloterr.core.GetWebsiteHtml`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.piloterr 1.0.0](https://connectors.appmixer.com/connector/appmixer.piloterr/1.0.0.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.piloterr/1.0.0/component/appmixer.piloterr.core.GetWebsiteHtml>

Fetch the HTML of a public web page with Piloterr. Choose the crawler (plain HTTP), rendering (headless browser for JavaScript pages) or web unlocker (anti-bot protection) engine.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| URL (`url`) | text | Public URL of the page, starting with `http://` or `https://`. |
| Engine (`engine`) | select | `crawler` is the cheapest; `rendering` runs a headless browser; `webunlocker` gets past anti-bot protection. |
| Save HTML as File (`saveAsFile`) | toggle | Store the HTML as a file and output its file ID instead of the HTML text. Use it for large rendered pages. |

## Output ports

### Port `out`

| Field | Type | Description |
| --- | --- | --- |
| URL (`url`) | string | - |
| Engine (`engine`) | string | - |
| HTML (`html`) | string | - |
| File ID (`fileId`) | string | - |
| File Name (`filename`) | string | - |
| File Size (bytes) (`fileSize`) | integer | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.piloterr.core.GetWebsiteHtml",
  "label": "Get Website HTML",
  "description": "Fetch the HTML of a public web page with Piloterr. Choose the crawler (plain HTTP), rendering (headless browser for JavaScript pages) or web unlocker (anti-bot protection) engine.",
  "author": "Piloterr <josselin.liebe@piloterr.com>",
  "version": "1.0.0",
  "auth": {
    "service": "appmixer:piloterr"
  },
  "quota": {
    "manager": "appmixer:piloterr",
    "resources": "requests",
    "scope": {
      "userId": "{{userId}}"
    }
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "engine": {
            "type": "string"
          },
          "saveAsFile": {
            "type": "boolean"
          }
        },
        "required": [
          "url"
        ]
      },
      "inspector": {
        "inputs": {
          "url": {
            "type": "text",
            "index": 1,
            "label": "URL",
            "tooltip": "Public URL of the page, starting with <code>http://</code> or <code>https://</code>."
          },
          "engine": {
            "type": "select",
            "index": 2,
            "label": "Engine",
            "tooltip": "<code>crawler</code> is the cheapest; <code>rendering</code> runs a headless browser; <code>webunlocker</code> gets past anti-bot protection.",
            "defaultValue": "crawler",
            "options": [
              {
                "label": "Crawler",
                "value": "crawler"
              },
              {
                "label": "Rendering",
                "value": "rendering"
              },
              {
                "label": "Web Unlocker",
                "value": "webunlocker"
              }
            ]
          },
          "saveAsFile": {
            "type": "toggle",
            "index": 3,
            "label": "Save HTML as File",
            "defaultValue": false,
            "tooltip": "Store the HTML as a file and output its file ID instead of the HTML text. Use it for large rendered pages."
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "schema": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "title": "URL",
            "example": "https://example.com"
          },
          "engine": {
            "type": "string",
            "title": "Engine",
            "example": "crawler"
          },
          "html": {
            "type": "string",
            "title": "HTML",
            "example": "<!doctype html><html>...</html>"
          },
          "fileId": {
            "type": "string",
            "format": "appmixer-file-id",
            "title": "File ID",
            "example": "64f6f1f9193228000754082f"
          },
          "filename": {
            "type": "string",
            "title": "File Name",
            "example": "piloterr-crawler-1784548800000.html"
          },
          "fileSize": {
            "type": "integer",
            "title": "File Size (bytes)",
            "example": 45231
          }
        }
      }
    }
  ],
  "icon": "(data URI omitted)"
}
```
