# HTMLSectionSplitter

> **Class** in `langchain_text_splitters`

📖 [View in docs](https://reference.langchain.com/python/langchain-text-splitters/html/HTMLSectionSplitter)

Splitting HTML files based on specified tag and font sizes.

Requires lxml package.

## Signature

```python
HTMLSectionSplitter(
    self,
    headers_to_split_on: list[tuple[str, str]],
    **kwargs: Any = {},
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `headers_to_split_on` | `list[tuple[str, str]]` | Yes | List of tuples of headers we want to track mapped to (arbitrary) keys for metadata.  Allowed header values: `h1`, `h2`, `h3`, `h4`, `h5`, `h6`, e.g.: `[("h1", "Header 1"), ("h2", "Header 2"]`. |
| `**kwargs` | `Any` | No | Additional optional arguments for customizations. (default: `{}`) |

## Constructors

```python
__init__(
    self,
    headers_to_split_on: list[tuple[str, str]],
    **kwargs: Any = {},
) -> None
```

| Name | Type |
|------|------|
| `headers_to_split_on` | `list[tuple[str, str]]` |


## Properties

- `headers_to_split_on`
- `xslt_path`
- `kwargs`

## Methods

- [`split_documents()`](https://reference.langchain.com/python/langchain-text-splitters/html/HTMLSectionSplitter/split_documents)
- [`split_text()`](https://reference.langchain.com/python/langchain-text-splitters/html/HTMLSectionSplitter/split_text)
- [`create_documents()`](https://reference.langchain.com/python/langchain-text-splitters/html/HTMLSectionSplitter/create_documents)
- [`split_html_by_headers()`](https://reference.langchain.com/python/langchain-text-splitters/html/HTMLSectionSplitter/split_html_by_headers)
- [`convert_possible_tags_to_header()`](https://reference.langchain.com/python/langchain-text-splitters/html/HTMLSectionSplitter/convert_possible_tags_to_header)
- [`split_text_from_file()`](https://reference.langchain.com/python/langchain-text-splitters/html/HTMLSectionSplitter/split_text_from_file)

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/8fec4e7ceee2c368b068c49f9fed453276e210e7/libs/text-splitters/langchain_text_splitters/html.py#L363)