This GitHub Gist repository contains Python code examples referenced in the Working with Documents chapter of the Aspose.HTML for Python via .NET documentation. These gists demonstrate practical ways to load, read, create, modify, and save HTML documents programmatically using powerful Aspose.HTML for Python via .NET API.
This Gist demonstrates the basics of creating, manipulating, and saving documents using the Aspose.HTML library for Python via .NET. The code snippets illustrate how to:
- Create a new, empty HTML document.
- Load an HTML document from a string variable, local file, URL, or memory stream.
- Load and save SVG documents, allowing you to manipulate scalable vector graphics using the DOM.
- Edit the HTML DOM (Document Object Model) by creating new elements and adding them to the document structure.
- Save HTML in MHTML or Markdown formats.
- Save edited documents to your local drive, ensuring all changes and associated files are saved correctly.
Aspose.HTML for Python via .NET is a cross-platform API for creating, editing, and converting HTML, SVG, EPUB, MHTML, and Markdown files. It offers headless browser capabilities, full DOM and CSS control, and conversion to formats like PDF, DOCX, XPS, or images—without relying on external software.
- Python 3.5+
- .NET Core / .NET 5+ runtime
- Windows, macOS, or Linux
- Aspose.HTML for Python via .NET installed from PyPI
- Install the Aspose.HTML Python package:
pip install aspose-html-net
- Clone or download this gist to your local machine.
- Configure input/output paths, data directories, and font folders if needed.
- Run the example in your environment.