我必须使用beautifulsoup,但是我不知道我必须使用哪个解析器。我对lxml和html.parser犹豫不决,或者为什么不两者都选择。如何知道网页是否符合lxml?如何知道网页是否符合html解析器?非常感谢
我提取一个数据集行:
(u"[('x-xss-protection', '1; mode=block'), ('x-powered-by', 'PHP/5.4.21 ZendServer/6.2.0'), ('transfer-encoding', 'chunked'), ('expires', '0'), ('vary', 'Accept-Encoding'), ('server', 'nginx'), ('last-modified', 'Thu, 03 Dec 2015 10:20:02 GMT'), ('connection', 'keep-alive'), ('pragma', 'no-cache'), ('cache-control', 'must-revalidate, post-check=0, pre-check=0, public'), ('date', 'Thu, 03 Dec 2015 10:20:02 GMT'), ('x-cached', 'EXPIRED'), ('content-type', 'text/html')]",)
Run Code Online (Sandbox Code Playgroud)
我想找到'内容类型'.我尝试过dict,list,enumerate,str,......但是没有任何作用:(