相关疑难解决方法(0)

如何在Python中生成HTML文本的目录?

假设我有一些HTML代码,就像这样(从Markdown或Textile或其他东西生成):

<h1>A header</h1>
<p>Foo</p>
<h2>Another header</h2>
<p>More content</p>
<h2>Different header</h2>
<h1>Another toplevel header
<!-- and so on -->
Run Code Online (Sandbox Code Playgroud)

我怎么能用Python为它生成一个目录?

html python tableofcontents

1
推荐指数
1
解决办法
722
查看次数

标签 统计

html ×1

python ×1

tableofcontents ×1