python爬虫对于gb2312
2024-10-11 12:15:11
对于刚刚接触python爬虫的人,常常会碰到一个比较烦的问题,
如果网页是GB2312编码格式,我们直接decode(’GB2312‘)一般python都会报错:
GB2312不能编码该页面。
这就比较奇怪了
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
网页的charset明明是GB2312,却出错了。
事实上微软将 gb2312 和 gbk 统一映射为 gb18030,这个问题也比较无语大家可以参考:
http://powerelite.blog.163.com/blog/static/429658912014394820777/
最新文章
- attr和prop
- IOS第四天(3:数组的排序和乱序)
- windows 下 文件属性及目录列表操作
- Python 时间函数
- 括号匹配算法 C语言实现
- hdu 5057 Argestes and Sequence
- VxWorks6.6 pcPentium BSP 使用说明(二):创建启动盘
- select value from v$diag_info where name=&#39;Default Trace File&#39;;
- gem devise配置
- diskpart 的简单使用
- linux centos 安装Jenkins(非docker方式)
- java.io.IOException: There appears to be a gap in the edit log. We expected txid ***, but got txid
- AD、PADS、Cadence对比
- eureka服务注册发现流程和核心参数
- 【Linux】Centos下安装ffmpeg
- KSQL和Flink SQL的比较
- Eloquent JavaScript #07# Project: A Robot
- P4071 [SDOI2016]排列计数
- HDU 1535 SPFA 前向星存图优化
- IllegalStateException: Unable to find a @SpringBootConfiguration