- 首先拥有Python环境
pip install requests
安装Python常用的requests依赖库- 【Python请求拉取网页上的内容】通过请求获取所需页面前端代码或者接口结果
page = requests.get(url="https://facebug555.com").text print(page)result = requests.get(url="https://facebug555.com").json() print(result)
- 通过requests发送文件
file_data = https://www.it610.com/article/{'file': ('1.txt', 'xxxxxxx')} upload_result = requests.post( url='https://facebug555.com', files=file_data).json() print(upload_result)