擅长:python、mysql、java
<p>您需要做的是使现有的<em>对象的美化组</em>对象index.html</em>文件。使用新数据修改,然后覆盖<em>index.html</em>具有对象的字符串表示。<em><a href="https://www.crummy.com/software/BeautifulSoup/bs4/doc/#modifying-the-tree" rel="nofollow noreferrer">Modifying the tree section of the bs4 documentation</a></em>提供了有关可用于执行此操作的各种方法的信息。</p>
<p>一个简单的例子。</p>
<p><em>index.html</em></p>
<pre><code><!DOCTYPE html>
<html lang="en">
<head>
<title>Test Page</title>
</head>
<body>
<! I want to insert here >
</body>
</html>
</code></pre>
<p><em>修改文件的代码</em></p>
^{pr2}$
<p><em>修改index.html</em></p>
^{pr3}$