我的问题是我想检查一个名为的 xml 变量中的一个变量,xmlauthor
并且我想检查它上面是否基本上写了一些东西。我该怎么做?这是我到目前为止所写的:
for num in ic :
xmlauthor = dom.getElementsByTagName("author")[0]
if not xmlauthor:
content += "***Changes by:" + xmlauthor + "*** \n \n"
else:
content += "***Changes are made Anonumously** \n \n"
这是我在控制台上遇到的错误
content += "***Changes by:" + xmlauthor + "*** \n\n"
TypeError: cannot concatenate 'str' and 'instance' objects