# Python で HTML ファイルをマージする

> Python で HTML を HTML にマージします。 Python ライブラリ API を使用して HTML ファイルを結合する

Source: https://products.aspose.com/slides/ja/python-net/merge/html-to-html/
Updated: 2023-04-07



## Aspose.Slides を使用して HTML を HTML にマージ

[**Aspose.Slides for Python via .NET**](https://products.aspose.com/slides/ja/python-net/) is a powerful Python library used to create, convert, merge, and manipulate presentations, HTML files, and other documents. When you merge HTML to HTML, you are effectively combining the contents from 2 documents to obtain one HTML file. Aspose.Slides allows you merge HTML docs in different ways. You get to merge HTML with all their texts, formatting,styles, etc.

## Merge HTML to HTML in Python

Using [**Aspose.Slides for Python via .NET**](https://products.aspose.com/slides/ja/python-net/), you can merge HTML files quickly with just a few lines of code

### Python code for merging HTML to HTML

```python

import aspose.slides as slides
import aspose.pydrawing as drawing

with slides.Presentation() as pres:
    pres.slides.remove_at(0)
    pres.slides.add_from_html(htmlText1)
    pres.slides.add_from_html(htmlText2)

    pres.save("pres.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 ドキュメントを保存します。

## 他のファイルをマージする
