如何处理“lxml.etree.XMLSyntaxError”?

时间:2017-12-05 03:26:29

标签: python-3.x web web-crawler lxml

当我使用lxml.etree解析某个页面时,会发生如下错误

lxml.etree.XMLSyntaxError: Double hyphen within comment: <!--[if lte IE 9 ]>

页面的头部代码就像

<!--[if lt IE 7 ]><html class="ie6 domain_so"><![endif]-->
<!--[if IE 7 ]><html class="ie7 domain_so"><![endif]-->
<!--[if IE 8 ]><html class="ie8 domain_so"><![endif]-->
<!--[if IE 9 ]><html class="ie9 domain_so"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--><html class="w3c domain_so"><!--<![endif]-->

如何处理?

0 个答案:

没有答案
相关问题