# Python で HTML を編集する

> Python で HTML を編集します。 Python ライブラリ API を使用して HTML ファイルを編集する

Source: https://products.aspose.com/slides/ja/python-net/editor/html/
Updated: 2022-12-23



## Aspose.Slides を使用して HTML を編集する

[**Aspose.Slides for Python via .NET**](https://products.aspose.com/slides/ja/python-net/) は、プレゼンテーション、HTML ドキュメント、およびその他のファイルの操作と編集に使用される強力な Python ライブラリです。 .新しいテキスト行を追加することで、HTML ドキュメントを編集できます。

## Python で HTML を編集する

[**Aspose.Slides for Python via .NET**](https://products.aspose.com/slides/ja/python-net/) を使用すると、HTML ドキュメントに新しいテキスト行を追加できます。コード行。

### HTML を編集するための Python コード

```python

import aspose.slides as slides

with slides.Presentation() as pres:
    pres.slides.remove_at(0)
    with open("page.html", "rt") as stream:
        data = stream.read()
    pres.slides.add_from_html(data)

    shape = pres.slides[0].shapes.add_auto_shape(slides.ShapeType.RECTANGLE, 10, 10, 100, 50)
    shape.text_frame.text = "New text"

    pres.save("page.html", slides.export.SaveFormat.HTML5)
```

## Python で HTML を編集する方法

Install **Aspose.Slides for Python via .NET**. See [**Installation**](https://docs.aspose.com/slides/python-net/installation/).

ライブラリを参照としてプロジェクトに追加します。

プレゼンテーション クラスのインスタンスを作成します。

編集する HTML ドキュメントを読み込みます。

新しいテキスト行を追加します。

変更した HTML ファイルを保存します。

## 他のファイルを編集する
