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