样本输入:Thisismytext.我正在尝试美丽的小组,以将XML的信息提取到CSV中。我所需的输出是code1,code2,code3,txttextA,textB,textC,Thisismytext.我一直在玩这个示例代码,我发现这里:它在提取方面起作用txt但不在标签中的Code1,code2,code3中subj.if__name__=='__main__':withopen('sample.csv','w')asfhandle:writer=csv.writer(fhandle)writer.writerow(('code1','code2','code3','text'))fo