报错情况是这样的:
AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'getchildren'
以下是这位热心的博主给出的方法:
针对这个报错情况,我的源码与这位博主的不同,所以我放出来(下面提到的),有这样的两个例子存在,为了让大家参考以便更好理解。
我的源码是:target_list = child.getchildren()
改后(等号左边不变,右边变了):target_list = list(child)