嘿,伙计们,能帮帮我吗?我想用python请求打开xml。我想在html站点中打开某些行。我的xml的名称是out.xml 这是我的实际代码:
import lxml.html.builder as html
from lxml import etree
nodeTable=html.BODY(html.TABLE)
for i in range(0, 20 ):
nodeRow=html.TR(html.TD("user", style="background-color:#FF0000"), html.TD("blabla"), html.TD("zweite zeile"))
nodeTable.append(nodeRow)
print etree.tostring(nodeTable)
with open("out.html", "wb") as f:
f.write(etree.tostring(nodeTable))
很明显,我不想有“第一排”和“第二排”。在这个职位上,我希望有自己的xml结果。我感谢你的帮助:)
成功导入此文件后,您可以使用Css网格(Display:grids)并在html文件中显示您的行位置
相关问题 更多 >
编程相关推荐