---
Product: html
Platform: python
Page Type: reference
Canonical URL: https://reference.aspose.org/html/python/customelementregistry
---

# CustomElementRegistry

## Overview

`CustomElementRegistry` is a class in Aspose.HTML FOSS for Python.

CustomElementRegistry lets developers define, retrieve, and upgrade custom HTML elements at runtime.

This class declares 6 methods for CustomElementRegistry objects in Python programs.
Available methods include: `__init__`, `define`, `get`, `get_name`, `upgrade`, `when_defined`.
Public members are accessible to any Python application after installing the Aspose.HTML FOSS for Python package.

## Methods

| Signature | Description |
|-----------|-------------|
| `__init__(document: "Document")` | Calls __init__(document) on this CustomElementRegistry instance. |
| `define(name: str, constructor: type, observed_attributes: tuple[str, ...])` | Calls define(name, constructor, observed_attributes) on this CustomElementRegistry instance. |
| `get(name: str)` → `"type[HTMLElement] \| None"` | Calls get(name) on this CustomElementRegistry instance. |
| `get_name(constructor: type)` → `str \| None` | Calls get_name(constructor) on this CustomElementRegistry instance. |
| `upgrade(root: "Node")` | Calls upgrade(root) on this CustomElementRegistry instance. |
| `when_defined(name: str)` → `str \| None` | Calls when_defined(name) on this CustomElementRegistry instance. |

## See Also

- [Aspose.HTML for Python — Enterprise API Reference](https://reference.aspose.com/html/python-net/)