49 lines
1.2 KiB
Python
49 lines
1.2 KiB
Python
import pandas as pd
|
|
import requests
|
|
from module import F6_module
|
|
import time
|
|
from tqdm import tqdm
|
|
|
|
f6_module = F6_module()
|
|
|
|
# 1.向服务器发送请求登录
|
|
|
|
username = "13690727570"
|
|
password = "Jz112233"
|
|
store_name = "F6汽车科技数据组测试(废弃)"
|
|
|
|
res = f6_module.login_in(username, password, store_name)
|
|
cookies = requests.utils.dict_from_cookiejar(res.cookies)
|
|
|
|
url = "https://yunxiu.f6car.cn/member/car/carListForPermission"
|
|
|
|
json = {
|
|
"pageNo": 1,
|
|
"pageSize": 10,
|
|
}
|
|
|
|
res = requests.post(url, cookies=cookies, json=json)
|
|
print(res.json())
|
|
total = res.json().get('data').get('total')
|
|
total = int(total)
|
|
total_pages = int(total / 100) + 1
|
|
all_data = []
|
|
|
|
for page in tqdm(range(1, total_pages + 1)):
|
|
json = {
|
|
"pageNo": page,
|
|
"pageSize": 10,
|
|
}
|
|
res = requests.post(url, cookies=cookies, json=json)
|
|
car_list = res.json().get('data').get("data")
|
|
for car in car_list:
|
|
all_data.append(
|
|
{"车辆id":car.get("tmCarInfo").get("pkId"),
|
|
"车牌":car.get("tmCarInfo").get("carPrefix")+car.get("tmCarInfo").get("carNo")
|
|
}
|
|
)
|
|
|
|
df = pd.DataFrame(all_data)
|
|
|
|
df.to_csv(fr"D:\Idea Project\F6+宜搭+其它(1)\张阳脚本\文件输出\查询车辆id.csv", index=False)
|