Python版本:3.X
IDE:jupyter
urllib介绍
官方说明
https://docs.python.org/3/library/urllib.html
urllib is a package that collects several modules for working with URLs:
urllib.request for opening and reading URLs
urllib.error containing the exceptions raised by urllib.request
urllib.parse for parsing URLs
urllib.robotparser for parsing robots.txt files
翻译:
urllib是一个包含了多个模块用于收集url信息的一个包:
1.urllib.request模块是用来打开和读取URLs的;
2.urllib.error模块包含一些有urllib.request产生的错误,可以使用try进行捕捉处理;
3.urllib.parse模块包含了一些解析URLs的方法;
4.urllib.robotparser模块用来解析robots.txt文本文件。
补充说明
在p