一、静态数据与动态数据
二、抓包并找到所需的 url 请求
import requests # 发送网络请求的工具包
url = 'https://ljgk.envsc.cn/OutInterface/GetPSList.ashx?regionCode=0&psname=&SystemType=C16A882D480E678F&sgn=53714a5a671094f0713121b8aa80c968545dda81&ts=1672728797782&tc=51567022'
resp = requests.get(url)
data = resp.json()
for i in data:
ps_name = i['ps_name']
create_time = i['create_time']
fullregion_name = i['fullregion_name']
with open('trash.csv', 'a+') as file: # 保存文件到 trash.csv
file.write('{}, {}, {}\n'.format(ps_name, create_time, fullregion_name))
抓取到的结果 trash.csv 文件: