faceinf 发表于 2022-5-18 21:14:40

Python请求拉取网页上的内容


1.首先拥有Python环境
2.pip install requests安装Python常用的requests依赖库
3.通过请求获取所需[页面](https://facebug555.com)[前端](https://hongquekol.com)[代码](https://99diy.com)或者接口结果
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)

wwwwwllllk 发表于 2022-5-18 23:05:13

ggnb666!!!

19121922715 发表于 2022-5-27 21:12:45

不太会用啊

faceinf 发表于 2022-6-22 15:55:32

19121922715 发表于 2022-5-27 21:12
不太会用啊

有啥不会用的啊。
这不挺简单的。
页: [1]
查看完整版本: Python请求拉取网页上的内容