开发者

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

开发者 https://www.devze.com 2023-02-23 19:36 出处:网络
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 xp

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

精彩评论

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