lxml.etree, element.text doesn't return the entire text from an element

后端 未结 8 844
梦毁少年i
梦毁少年i 2021-02-07 10:39

I scrapped some html via xpath, that I then converted into an etree. Something similar to this:

 text1  link  text2 
<         


        
8条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-07 10:43

    Use element.xpath("string()") or lxml.etree.tostring(element, method="text") - see the documentation.

提交回复
热议问题