补天公益src名单爬取
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import requests
import json
def main(page):
url = "https://www.butian.net/Reward/pub"
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"
}
data = {"p":page}
jsondata = json.loads(requests.post(url,data=data,headers=headers).content.decode("utf-8"))
data = jsondata["data"]["list"]
for i in data:
company = i["company_name"]
with open("butiancompany.txt","a+") as f:
f.write(company + "\n")
for i in range(1,192+1):
main(i)
本文由作者按照 CC BY 4.0 进行授权