开发者

Get charset attribute of meta element in (X)HTML document with xpath

I am doing some web scraping stuff with python. But as you know some web pages has different charsets. I need to get those web pages charset. So 开发者_开发知识库long story short, for lxml, What is xpath pattern?

Thank you.


This:

/html/head/meta[@http-equiv='Content-Type']/@content

HTML5:

/html/head/meta/@charset
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜