python3.5中urlopen出错
2017-04-16 10:49
246 查看
在Python3.5中urllib已经被整合了
具体官方文档:
a new urllib package was created. It consists of code from
urllib, urllib2, urlparse, and robotparser. The old
modules have all been removed. The new package has five submodules:
urllib.parse, urllib.request, urllib.response,
urllib.error, and urllib.robotparser. The
urllib.request.urlopen() function uses the url opener from
urllib2. (Note that the unittests have not been renamed for the
beta, but they will be renamed in the future.)
urlopen()用法:
import urllib.request
url=”http://www.baidu.com”
get=urllib.request.urlopen(url).read()
print(get)
具体官方文档:
a new urllib package was created. It consists of code from
urllib, urllib2, urlparse, and robotparser. The old
modules have all been removed. The new package has five submodules:
urllib.parse, urllib.request, urllib.response,
urllib.error, and urllib.robotparser. The
urllib.request.urlopen() function uses the url opener from
urllib2. (Note that the unittests have not been renamed for the
beta, but they will be renamed in the future.)
urlopen()用法:
import urllib.request
url=”http://www.baidu.com”
get=urllib.request.urlopen(url).read()
print(get)
相关文章推荐
- Python 3.5 + PyInstaller 3.2.1打包exe出错,TypeError: read() takes no keyword arguments
- python3.5里面 urlopen 代理不能识别proxies关键字的问题
- Python3.5 tab补全 yum出错解决
- python3.5 urllib.request.urlopen 中文url问题
- python3.5 URLError: <urlopen error [Errno 10061]报错解决方法
- [转]ubuntu10.10升级到11.04过程中python2.7升级出错的解决方法(安装wine过程中出错)
- Python中Socket服务器打开端口出错原因分析 .
- 安装 MySQL-python 出错 ImportError: No module named setuptools
- Windows上Python读取stdin出错
- python httplib2 - 使用代理出错
- python 使用 unicode 出错
- Cent os 升级python到2.5后yum安装出错
- 在Ubuntu 10.04上安装Mysql-python出错
- 转载:python中字符串的最后一个字符是斜杠会导致出错
- Windows上Python读取stdin出错
- .net framework 3.5安装出错解决办法
- python版本导致print出错z
- dbus-python 在 thread 中运行时会随机出错
- crontab中运行python程序出错,提示ImportError: No module named解决全过程
- python实例31[urllib.request.urlopen获取股票信息]