Location
Overview
Location is a class in Aspose.HTML FOSS for Python.
The Location class mirrors the browser location object, allowing assign, replace, and reload of URLs and exposing href, protocol, host, pathname, search, and hash components.
This class declares 4 methods for Location objects in Python programs.
Available methods include: __init__, assign, reload, replace.
Public members are accessible to any Python application after installing the Aspose.HTML FOSS for Python package.
Properties: hash, host, hostname, href, pathname, port, and 2 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
href | str | Read/Write | Current document URL string. |
protocol | str | Read/Write | Gets or sets the protocol. |
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. |
Methods
| Signature | Description |
|---|---|
__init__(window: "Window") | Calls init(window) on this Location instance. |
assign(url: str) | Push a same-document navigation-style history entry. |
replace(url: str) | Replace the current history entry URL in-memory. |
reload() | Compatibility stub for browser-style location.reload(). |