1. 首页
  2. 数据库
  3. 其它
  4. Python学习–第六天

Python学习–第六天

上传者: 2020-12-22 23:41:14上传 PDF文件 38.18KB 热度 20次
一、通过urllib库爬取网站的源码 方法一:直接爬取(没有限制的情况下) import urllib.request response = urllib.request.urlopen('http://chongqingtravel.cn/') print(response.read().decode('utf-8')) print(response.getheader('Server'))#web服务器类型 运行结果: "F:\Python 3.8.0\python.exe" ****** nginx Process finished with exit code 0 方法
下载地址
用户评论