requests模块:
-urllib模块 -requests模块(更高效)
requests模块:模拟浏览器发送请求
如何使用:
-指定url url=' ';
-发起请求 response= requests.get(url=url)
-获取响应数据 page_text=response.text //网页源码数据
-持久化存储 with open('文件路径/文件名','读写方式',encoding='utf-8') as fp: fp.write(page_text) //
将数据存入
环境安装:pip install requests import requsets
标签:fp,url,text,模块,requests,response From: https://www.cnblogs.com/ylxb-1/p/17030140.html