# HTML Scraper

Automatically scrape full HTML source code and metadata from any public web page. Just supply the URL(s) - no login, no coding, no setup - and receive structured data ready for export in minutes.

- Template page: [https://www.octoparse.com/template/html-scraper](https://www.octoparse.com/template/html-scraper)
- Categories: Directories
- Status: `PUBLISHED`
- Run mode: `BOTH`

## Pricing

Free.

## What is an Octoparse template?

An Octoparse template is a ready-to-use scraping workflow with predefined inputs and structured outputs. Use the exact parameter keys below; do not invent parameters.

## Overview

This ready-to-use template collects structured data from general web pages.

## Output

The current workflow extracts 2 fields, including `Original_URL`, `Source_code`.

## Use Cases

- Use structured results for research, comparison, and monitoring.
- Collect rows without building the extraction workflow from scratch.
- Combine results with other templates for downstream enrichment.
- Review a representative result before starting a large batch.

## Why Octoparse

- **No coding required:** complete URLs (up to 10,000 per run), Scroll for One Screen (times), Scroll to the Bottom of Webpage (times) and start the template in local or cloud mode.
- **Flexible export:** review and export results as CSV, Excel, or JSON.

## Input

### URLs (up to 10,000 per run)

Required. Up to 10,000 per run, separate by line breaks. For large datasets, consider splitting them into multiple runs. Constraints: minItems=1; maxItems=10000; items.minLength=1; items.maxLength=10000.

### Scroll for One Screen (times)

Optional. Number of times to scroll down by one screen height. Leave blank to skip.

### Scroll to the Bottom of Webpage (times)

Optional. Number of times to scroll to the bottom of the page. Leave blank to disable.

### Wait Before Extraction (seconds)

Optional. Number of seconds to wait before starting extraction. Useful for slow-loading pages.

## How to Use

### HTML Scraper Template

Extracts full HTML source and meta tags (title, description, keywords) from a list of URLs.

---

### Important Notes & Best Practices

- Works only with publicly accessible pages. Login, cookies, or complex dynamic rendering may require a custom workflow.
- Meta tags are extracted exactly as they appear on the page. If a page lacks a description or keywords, those fields will be blank.
- All URLs in a single run must belong to the **same domain**.
- Login or authentication-based scraping is not supported.
- Retrieves the full HTML source (not simplified or text-only).
- For large batches of URLs, split into multiple runs or use scheduled cloud tasks for stability.
- Ensure your data collection complies with the target site's Terms of Service and applicable regulations.

---

### Step-by-Step Guide

1. **Start the template** – Click **"Try it!"** or **"Start"** to load the HTML Scraper.

2. **Enter your scraping parameters** – Fill in the input fields:

| Parameter | Required | Description | Example |
|-----------|----------|-------------|---------|
| `URLs` | Required | Up to 10,000 per run, separate by line breaks. For large datasets, split into multiple runs. | `https://example.com/page1` |
| `Scroll for One Screen (times)` | Optional | Number of times to scroll down by one screen height. Leave blank to skip. | `3` |
| `Scroll to the Bottom of Webpage (times)` | Optional | Number of times to scroll to the bottom of the page. Leave blank to disable. | `1` |
| `Wait Before Extraction (seconds)` | Optional | Seconds to wait before starting extraction. Useful for slow-loading pages. | `5` |

3. **Run the scraper** – Click **"Start"** and select a supported run mode (greyed-out modes are not supported). Octoparse will browse the URLs, scroll, and extract the data.

4. **Monitor & handle interruptions** – Scraping duration depends on the number of URLs. If a CAPTCHA appears, pause the task, solve it manually, then resume.

5. **Export your data** – Once scraping completes, go to the output section, review the data, and export as CSV or Excel for further analysis.

## Limitations

Results depend on what the source site exposes at run time. Fields may be empty when a source page does not provide a value. The template enforces the input limits shown above.

## Tips

Use specific, valid inputs and review a representative result before starting a large batch. Remove duplicate inputs when repeated records are not needed.

## FAQ

### What do I need to enter?

Use the exact inputs and limits listed above.

### What data does this template return?

See Output Schema below; availability can vary by source record.

### How is usage billed?

See the Pricing section above for current pricing and billing details.

## Related Templates

- [eBay Listing Page Scraper (by keyword)](https://www.octoparse.com/template/ebay-product-list-scraper-by-keyword)
- [eBay Scraper](https://www.octoparse.com/template/ebay-scraper)
- [Google Search Scraper](https://www.octoparse.com/template/google-search-scraper)
- [Google Maps Listings Scraper (by Keywords)](https://www.octoparse.com/template/google-maps-scraper-listing-page-by-keyword)
- [Google Maps Email Scraper & Extractor](https://www.octoparse.com/template/google-maps-contact-scraper)

## Input Schema

```json
{
  "title": "HTML Scraper input",
  "description": "Input parameters configured for the current published template version.",
  "type": "object",
  "schemaVersion": 1,
  "additionalProperties": false,
  "properties": {
    "uRLs": {
      "title": "URLs (up to 10,000 per run)",
      "description": "Up to 10,000 per run, separate by line breaks. For large datasets, consider splitting them into multiple runs.",
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 10000
      },
      "minItems": 1,
      "maxItems": 10000,
      "x-octoparse": {
        "apiEnabled": true
      }
    },
    "scroll_for_One_Screen": {
      "title": "Scroll for One Screen (times)",
      "description": "Number of times to scroll down by one screen height. Leave blank to skip.",
      "type": "integer",
      "x-octoparse": {
        "apiEnabled": true
      }
    },
    "scroll_to_the_Bottom_of_Webpage": {
      "title": "Scroll to the Bottom of Webpage (times)",
      "description": "Number of times to scroll to the bottom of the page. Leave blank to disable.",
      "type": "integer",
      "x-octoparse": {
        "apiEnabled": true
      }
    },
    "wait_Before_Extraction": {
      "title": "Wait Before Extraction (seconds)",
      "description": "Number of seconds to wait before starting extraction. Useful for slow-loading pages.",
      "type": "integer",
      "x-octoparse": {
        "apiEnabled": true
      }
    }
  },
  "required": [
    "uRLs"
  ]
}
```

## Input JSON Example

No verified real input/output examples are currently available.


## Output Schema

```json
{
  "schemaVersion": 1,
  "type": "object",
  "properties": {
    "Original_URL": {
      "type": "string",
      "description": ""
    },
    "Source_code": {
      "type": "string",
      "description": ""
    }
  },
  "title": "HTML Scraper output",
  "description": "Initial output fields derived from the current published implementation. Field descriptions are maintained by Data Center; production field names and types should be refreshed from recent successful runs.",
  "additionalProperties": false
}
```

## Output Example

No verified real input/output examples are currently available.

## API

`POST https://openapi.octoparse.com/api/agentTools/executeTask`

This is the OpenAPI Agent Tools `executeTask` endpoint. Authenticate with a Bearer token.

Request body:

`templateName` is the template slug; `parameters` is a JSON object string whose keys match Input Schema; `taskName`, `idempotencyKey`, and `maxCollectedRows` are optional.

Obtain a token:

```http
POST https://openapi.octoparse.com/token
Content-Type: application/json

{
  "username": "YOUR_USERNAME",
  "password": "YOUR_PASSWORD",
  "grant_type": "password"
}
```

Use `data.access_token` as `Authorization: Bearer <token>`. After starting, poll `getTaskStatus` and export with `exportData`.

No verified real input/output examples are currently available.

## MCP Setup

Connect an MCP-compatible AI client to `https://mcp.octoparse.com` using browser OAuth or an Octoparse API key. Find `html-scraper`, inspect its inputs, create a cloud task with the exact Input Schema keys, and export JSON results.

## Machine-readable Resources

- [Template contract](https://www.octoparse.com/templates/html-scraper.json)
- [Manifest](https://www.octoparse.com/templates/html-scraper-manifest.json)
