lxml truncates text that contains 'less than' character

前端 未结 2 974
情歌与酒
情歌与酒 2020-12-19 11:19
>>> s = \'
< 20
\' >>> import lxml.html >>> tree = lxml.html.fromstring(s) >>> lxml.etree.tostring(tree
2条回答
  •  春和景丽
    2020-12-19 11:37

    Your < should actually be <, since < is sorta like a 'reserved character' in html. Then it should work.

提交回复
热议问题