我使用的是Python beautifulsoupversion3。 我的xml看起来像这样(它来自docx格式):-
<w:r w:rsidRPr="00541D75">
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
<w:b/>
<w:color w:val="1F497D" w:themeColor="text2"/>
<w:sz w:val="24"/>
<w:szCs w:val="24"/>
</w:rPr>
<w:t>Mandatory / Optional</w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>
我想从标签'w:t'中提取内容,所以这就是我做过:在
^{pr2}$这是我的错误消息得到:在
print soup.findAll('w:t')
UnicodeEncodeError: 'ascii' codec can't encode character u'\u201c' in position 43: ordinal not in range(128)
美丽的物体必须定义如下:
或者
^{pr2}$在doc specified中。在
相关问题 更多 >
编程相关推荐