Aspose.HTML for Python via .NET is a powerful API for Python that provides a headless browser functionality, allowing you to work with HTML documents in a variety of ways. With this API, you can easily create new HTML documents or open existing ones from different sources. Once you have the document, you can perform various manipulation operations, such as removing and replacing HTML nodes.
Project description
Process & Manipulate HTML via Python API
Product Page | Docs | Demos | API Reference | Examples | Blog | Search | Free Support
Aspose.HTML for Python via .NET is a powerful API for Python that provides headless browser functionality, allowing you to work with HTML documents. With this API, you can easily create new HTML documents or open existing ones from different sources. Once you have the document, you can perform various manipulation operations, such as removing and replacing HTML nodes, rendering, and converting HTML to other popular formats, etc.
HTML API Features
The following are some popular features of Aspose.HTML for Python via .NET:
- Convert HTML documents to a wide range of formats, including PDF, XPS, DOCX, and different image formats (PNG, JPEG, BMP, TIFF, and GIF).
- Load and convert SVG and EPUB to XPS, PDF, and images.
- Navigate through documents using either NodeIterator or TreeWalker.
- Set and control the timeout for the rendering process.
- Use MutationObserver to monitor DOM modifications.
- Populate HTML documents with external data sources such as XML and JSON.
- Support for both single (PDF, XPS) and multiple (image formats) output file streams.
- Extract CSS styling information from HTML documents.
- Configure a Sandbox environment that is independent of the execution machine, ensuring a secure and isolated environment for running and testing.
Read & Write Web Formats
- Web: HTML, XHTML, MHTML
- Other: SVG, MD (Markdown)
Save HTML As
- Fixed Layout: PDF, XPS
- Images: TIFF, JPEG, PNG, BMP, GIF
Read Formats
- EPUB
Platform Independence
Aspose.HTML for Python via .NET can be used to develop applications for a vast range of operating systems, such as Windows, where Python 3.5 or later is installed. You can build both 32-bit and 64-bit Python applications.
Get Started
Are you ready to give Aspose.HTML for Python via .NET a try?
Simply run pip install aspose-html-net
from the Console to fetch the package.
If you already have Aspose.HTML for Python via .NET and want to upgrade the version, please run pip install --upgrade aspose-html-net
to get the latest version.
You can run the following snippets in your environment to see how Aspose.HTML works, or check out the GitHub Repository or Aspose.HTML for Python via .NET Documentation for other common use cases.
Using Python to Convert HTML to Markdown (MD)
Aspose.HTML for Python via .NET allows you to convert HTML to PDF, XPS, Markdown, MHTML, PNG, JPEG, and other file formats. The following snippet demonstrates the conversion from HTML to GIT-based Markdown (MD) Format:
import os
from aspose.html import *
from aspose.html.converters import *
from aspose.html.saving import *
# Setup directories
output_folder = "output/"
input_folder = "data/"
if not os.path.exists(output_folder):
os.makedirs(output_folder)
# Prepare an HTML code and save it to the file
code = "<h1>Header 1</h1>" \
"<h2>Header 2</h2>" \
"<p>Hello World!!</p>"
document_path = os.path.join(input_folder, 'document.html')
output_path = os.path.join(output_folder, 'output.md')
with open(document_path, 'w', encoding="utf-8") as f:
f.write(code)
f.close()
# Call convert_html method to convert HTML to Markdown.
Converter.convert_html(document_path, MarkdownSaveOptions.git, output_path)
Product Page | Docs | Demos | API Reference | Examples | Blog | Search | Free Support | Temporary License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file aspose_html_net-24.10.0-py3-none-win_amd64.whl
.
File metadata
- Download URL: aspose_html_net-24.10.0-py3-none-win_amd64.whl
- Upload date:
- Size: 40.4 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5525030cbe4459a3d01ee44f361cb5e92435e6a767b80b610f0dfe06780c931c |
|
MD5 | 2de962bd63c80162a6a043eb95cf7b8e |
|
BLAKE2b-256 | 4a6a72aabcfec3f1143db708c1d5699b2a7645129f648eab8fff9a16fa17b9ca |
File details
Details for the file aspose_html_net-24.10.0-py3-none-win32.whl
.
File metadata
- Download URL: aspose_html_net-24.10.0-py3-none-win32.whl
- Upload date:
- Size: 36.3 MB
- Tags: Python 3, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25d8429ab9f1f9ff373d33db0f3862e1e5d3468a870137374f88d7cabb0c6a73 |
|
MD5 | 8e4d72f9c3059cc19a9cf30b48d648fc |
|
BLAKE2b-256 | c41b69eda39cefb6951edda1456d991f055fa5877eb5e195f34d05349f17eef1 |
File details
Details for the file aspose_html_net-24.10.0-py3-none-manylinux1_x86_64.whl
.
File metadata
- Download URL: aspose_html_net-24.10.0-py3-none-manylinux1_x86_64.whl
- Upload date:
- Size: 46.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b51461409cc6891ee2a2aa26d3d66ad2bd933c2faa99aa2d561f0d043643bed8 |
|
MD5 | bfa5274227e02e620e27a94de414c570 |
|
BLAKE2b-256 | d99728f71ba8a345f64cddd11af77973b72ccb6fd9492cef453fc6e06157ba48 |