【发布时间】:2010-12-01 00:58:07
【问题描述】:
在 HTML 页面的 body 中插入元素作为最后一个元素的最有效方法是什么?
【问题讨论】:
标签: python beautifulsoup
在 HTML 页面的 body 中插入元素作为最后一个元素的最有效方法是什么?
【问题讨论】:
标签: python beautifulsoup
请参阅我对上一个问题的相同回答:
以下应该插入就好了:
soup.body.insert(len(soup.body.contents), yourelement)
【讨论】:
content.replace("""</body>""", """%s</body>""" % NEW) ...我为什么在使用大炮之前没有想到这一点?