📌  相关文章
📜  如何使用美丽的汤更改元素的属性顺序 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:03.489000             🧑  作者: Mango

代码示例1
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))