Get the inner HTML of a element in lxml

后端 未结 6 2272
粉色の甜心
粉色の甜心 2020-12-13 19:10

I am trying to get the HTML content of child node with lxml and xpath in Python. As shown in code below, I want to find the html content of the each of product nodes. Does i

6条回答
  •  忘掉有多难
    2020-12-13 19:27

    from lxml import etree
    print(etree.tostring(root, pretty_print=True))
    

    you may see more examples here: http://lxml.de/tutorial.html

提交回复
热议问题