urllib2在python3后已经合并在urllib中了,具体为urllib.response,urllib.request
urllib2.URLError 改为了urllib.error.URLError
文章目录
URLError与HTTPError
关于这一点我看了另一个博主的,直接上他的URL吧,点击传送阿谋
下载网页(requests库也可以)
Y4tacker 博主文章分类:Python基础应用 ©著作权
urllib2在python3后已经合并在urllib中了,具体为urllib.response,urllib.request
urllib2.URLError 改为了urllib.error.URLError
关于这一点我看了另一个博主的,直接上他的URL吧,点击传送阿谋
Python爬虫重要的库
1. urllib简介:urllib可以说是Python最简单的网络数据请求库。urllib是Python自带的标准库,无需安装,直接可以用。 urllib为用户提供了下面的功能: 网页数据请求 响应结果获取 代理和cookie设置 异常处理 URL解析2. urllib实例:使用urllib获取百度首页的网页数据:#!/usr/bin/python3# -*- coding: UTF
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M