URL
Overview
URL is a class in Aspose.HTML FOSS for Python.
URL and URLSearchParams classes enable WHATWG‑style URL parsing and query‑parameter manipulation.
This class declares 7 methods for URL objects in Python programs.
Available methods include: __eq__, __hash__, __init__, __repr__, __str__, can_parse, parse.
Public members are accessible to any Python application after installing the Aspose.HTML FOSS for Python package.
Properties: hash, host, hostname, href, origin, password, and 6 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
href | str | Read/Write | Return the serialized URL string. |
protocol | str | Read/Write | Gets or sets the protocol. |
username | str | Read/Write | Return username from URL userinfo. |
password | str | Read/Write | Return password from URL userinfo. |
host | str | Read/Write | Gets or sets the host. |
hostname | str | Read/Write | Gets or sets the hostname. |
port | str | Read/Write | Gets or sets the port. |
pathname | str | Read/Write | Gets or sets the pathname. |
search | str | Read/Write | Gets or sets the search. |
hash | str | Read/Write | Gets or sets the hash. |
origin | str | Read | Gets the origin. |
search_params | URLSearchParams | Read | Gets the search params. |
Methods
| Signature | Description |
|---|---|
parse(input: str, base: str | "URL" | None) → "URL | None" | Return a URL instance, or None if the input is invalid. |
can_parse(input: str, base: str | "URL" | None) → bool | Return True when URL construction would succeed. |
__init__(href: str, base: str | "URL" | None) | Calls init(href, base) on this URL instance. |
__str__() → str | Calls str on this URL instance. |
__repr__() → str | Calls repr on this URL instance. |
__eq__(other: object) → bool | Calls eq(other) on this URL instance. |
__hash__() → int | Calls hash on this URL instance. |