Requests库安装
Requests库的作用是请求网站获得网页数据
在pycharm中安装方式如下:

选择settings

选择Project Interpreter,单击+号添加第三方库

BeautifulSoup库按同样方式安装。
Requests库


pycharm返回结果为<Response [200]>,说明请求网址成功。
BeautifulSoup库
BeautifilSoup库解析得到的Soup文档安装标准缩进格式的结构输出,为结构化的数据,为数据过滤提取做好准备。


源代码类似