手机
当前位置:查字典教程网 >脚本专栏 >python >python3抓取中文网页的方法
python3抓取中文网页的方法
摘要:本文实例讲述了python3抓取中文网页的方法。分享给大家供大家参考。具体如下:#!/usr/bin/python3.2importsysi...

本文实例讲述了python3抓取中文网页的方法。分享给大家供大家参考。具体如下:

#! /usr/bin/python3.2 import sys import urllib.request req = urllib.request.Request('http://www.baidu.com') response = urllib.request.urlopen(req) the_page = response.read() type = sys.getfilesystemencoding() #转换成本地系统编码 print(the_page.decode(type))

希望本文所述对大家的Python程序设计有所帮助。

【python3抓取中文网页的方法】相关文章:

python 中文乱码问题深入分析

wxpython 最小化到托盘与欢迎图片的实现方法

下载给定网页上图片的方法

python 获取本机ip地址的两个方法

python条件和循环的使用方法

盘点提高 Python 代码效率的方法

rhythmbox中文名乱码问题解决方法

tornado捕获和处理404错误的方法

python 自动提交和抓取网页

Python去掉字符串中空格的方法

精品推荐
分类导航