📅  最后修改于: 2022-03-11 14:46:03.489000             🧑  作者: Mango
from simplified_scrapy.simplified_doc import SimplifiedDoc
html ='''
'''
def toString(ele):
order = ['id','head','postag','from','lemma','relation']
result = '<'+ele.tag
for p in order:
result+=' {}="{}"'.format(p,ele[p])
return result+'/>'
doc = SimplifiedDoc(html)
ele = doc.word
print (toString(ele))