【发布时间】:2011-06-15 05:07:21
【问题描述】:
我正在尝试使用的代码是:
h = str(heading)
# '<h1>Heading</h1>'
heading.renderContents()
我收到此错误:
Traceback (most recent call last):
File "<pyshell#6>", line 1, in <module>
print h.renderContents()
AttributeError: 'str' object has no attribute 'renderContents'
有什么想法吗?
我有一个带有 html 标签的字符串,如果有其他方法,我需要清理它,请提出建议。
【问题讨论】:
标签: python html beautifulsoup