早上好,我正在寻找使用chilkat库将html转换为xml。但它向我抛出了这个错误。
import chilkat
a = "asd asd asd asd"
xml = a.toXml()
print(xml)Traceback (most recent call last):
File "C:\Users\acalobish\Desktop\iaa.py", line 4, in <module>
xml = a.toXml()
AttributeError: 'str' object has no attribute 'toXml' 发布于 2020-07-18 11:55:04
import chilkat
htmlToXml = chilkat.CkHtmlToXml()
# Indicate the charset of the output XML we'll want.
htmlToXml.put_XmlCharset("utf-8")
success = htmlToXml.ConvertFile("test.html","out.xml")
if (success != True):
print(htmlToXml.lastErrorText())
else:
print("Success")https://stackoverflow.com/questions/62964397
复制相似问题