Files
F6--/张阳脚本/竞品系统数据导出/稻田系统导出.ipynb
T
2026-01-30 11:28:35 +08:00

362 lines
13 KiB
Plaintext

{
"cells": [
{
"metadata": {},
"cell_type": "markdown",
"source": "# 车辆信息",
"id": "f7881b6d57bf77d2"
},
{
"cell_type": "code",
"id": "initial_id",
"metadata": {
"collapsed": true,
"ExecuteTime": {
"end_time": "2026-01-05T09:54:23.113999400Z",
"start_time": "2026-01-05T09:52:58.415160Z"
}
},
"source": [
"import requests\n",
"import time\n",
"from tqdm.notebook import tqdm\n",
"import pandas as pd\n",
"\n",
"cookies = {\n",
" 'feehi_session': '695b7d067fd99',\n",
"}\n",
"\n",
"headers = {\n",
" 'accept': '*/*',\n",
" 'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',\n",
" 'authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOjMwMTI2MDEwNTE1MjgxMDAwMSwic2NvcGVzIjoiYXQiLCJpc3MiOiJzaHVpZGFvLnNlcnZlciIsImF1ZCI6InNodWlkYW8uY2xpZW50IiwianRpIjoiZTkzNTUzIiwiaWF0IjoxNzY3NjAzODk1LjY1MTg3NSwibmJmIjoxNzY3NjAzODk1LjY1MTg3NSwiZXhwIjoxNzY3NjkwMjk1LjY1MTg3NX0.POSVuvUhvpWBoNqHypiMNL58eAzrSlHUmd-DOvt7-18',\n",
" 'origin': 'https://daotian.shuidao.com',\n",
" 'priority': 'u=1, i',\n",
" 'referer': 'https://daotian.shuidao.com/',\n",
" 'sec-ch-ua': '\"Microsoft Edge\";v=\"143\", \"Chromium\";v=\"143\", \"Not A(Brand\";v=\"24\"',\n",
" 'sec-ch-ua-mobile': '?0',\n",
" 'sec-ch-ua-platform': '\"Windows\"',\n",
" 'sec-fetch-dest': 'empty',\n",
" 'sec-fetch-mode': 'cors',\n",
" 'sec-fetch-site': 'same-site',\n",
" 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 Edg/143.0.0.0',\n",
" # 'cookie': 'feehi_session=695b7d067fd99',\n",
"}\n",
"\n",
"all_data = []\n",
"for i in tqdm(range(0, 174)):\n",
" rtick = str(int(time.time() * 1000))\n",
" params = {\n",
" 'key': '',\n",
" 'skip': 15 * i,\n",
" 'limit': '15',\n",
" 'rtick': rtick,\n",
" }\n",
"\n",
" response = requests.get('https://api.shuidao.com/daotian_web/customer/customer-list', params=params,\n",
" cookies=cookies, headers=headers)\n",
" res_data = response.json().get('res').get('list')\n",
" all_data.extend(res_data)\n",
"\n",
"df = pd.DataFrame(all_data)\n",
"df.to_excel(\"D:\\Idea Project\\F6+宜搭+其它(1)\\张阳脚本\\文件输出\\稻田车辆信息.xlsx\")\n",
"\n"
],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"<>:42: SyntaxWarning: invalid escape sequence '\\I'\n",
"<>:42: SyntaxWarning: invalid escape sequence '\\I'\n",
"C:\\Users\\hp_z66\\AppData\\Local\\Temp\\ipykernel_3692\\1310767323.py:42: SyntaxWarning: invalid escape sequence '\\I'\n",
" df.to_excel(\"D:\\Idea Project\\F6+宜搭+其它(1)\\张阳脚本\\文件输出\\稻田车辆信息.xlsx\")\n"
]
},
{
"data": {
"text/plain": [
" 0%| | 0/174 [00:00<?, ?it/s]"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "edadc9db42ef484c899c7d63c01dc3ce"
}
},
"metadata": {},
"output_type": "display_data",
"jetTransient": {
"display_id": null
}
}
],
"execution_count": 7
},
{
"metadata": {},
"cell_type": "markdown",
"source": "# 工单信息",
"id": "fcea901e3ea7ec4f"
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2026-01-06T01:18:48.885923Z",
"start_time": "2026-01-06T01:12:44.344552600Z"
}
},
"cell_type": "code",
"source": [
"import requests\n",
"import time\n",
"from tqdm.notebook import tqdm\n",
"import pandas as pd\n",
"\n",
"cookies = {\n",
" 'feehi_session': '695c609649781',\n",
"}\n",
"\n",
"headers = {\n",
" 'accept': '*/*',\n",
" 'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',\n",
" 'authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOjMwMTI2MDEwNTE1MjgxMDAwMSwic2NvcGVzIjoiYXQiLCJpc3MiOiJzaHVpZGFvLnNlcnZlciIsImF1ZCI6InNodWlkYW8uY2xpZW50IiwianRpIjoiZTkzNTUzIiwiaWF0IjoxNzY3NjYxNzE4LjMwMDE2OSwibmJmIjoxNzY3NjYxNzE4LjMwMDE2OSwiZXhwIjoxNzY3NzQ4MTE4LjMwMDE2OX0.J_-dwMBaXiUEYLWcYC-sNfo4hc2CLCy-4w3qqxUJYyU',\n",
" 'origin': 'https://daotian.shuidao.com',\n",
" 'priority': 'u=1, i',\n",
" 'referer': 'https://daotian.shuidao.com/',\n",
" 'sec-ch-ua': '\"Microsoft Edge\";v=\"143\", \"Chromium\";v=\"143\", \"Not A(Brand\";v=\"24\"',\n",
" 'sec-ch-ua-mobile': '?0',\n",
" 'sec-ch-ua-platform': '\"Windows\"',\n",
" 'sec-fetch-dest': 'empty',\n",
" 'sec-fetch-mode': 'cors',\n",
" 'sec-fetch-site': 'same-site',\n",
" 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 Edg/143.0.0.0',\n",
" # 'cookie': 'feehi_session=695c609649781',\n",
"}\n",
"\n",
"all_bill_data = []\n",
"for i in tqdm(range(0, 620)):\n",
" rtick = str(int(time.time() * 1000))\n",
" response = requests.get(\n",
" f'https://api.shuidao.com/daotian_web/maintain/intention-list?key=&status=0,1&pay_status=-1&type=-2&skip={15 * i}&limit=15&rtick=1767661717801',\n",
" cookies=cookies,\n",
" headers=headers,\n",
" )\n",
" res_data = response.json().get('res').get('list')\n",
" all_bill_data.extend(res_data)\n",
"\n",
"df1 = pd.DataFrame(all_bill_data)\n",
"df1.to_excel(\"D:\\Idea Project\\F6+宜搭+其它(1)\\张阳脚本\\文件输出\\稻田工单信息.xlsx\")"
],
"id": "c9bec35aa87c47cd",
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"<>:39: SyntaxWarning: invalid escape sequence '\\I'\n",
"<>:39: SyntaxWarning: invalid escape sequence '\\I'\n",
"C:\\Users\\hp_z66\\AppData\\Local\\Temp\\ipykernel_3692\\725055950.py:39: SyntaxWarning: invalid escape sequence '\\I'\n",
" df.to_excel(\"D:\\Idea Project\\F6+宜搭+其它(1)\\张阳脚本\\文件输出\\稻田工单信息.xlsx\")\n"
]
},
{
"data": {
"text/plain": [
" 0%| | 0/620 [00:00<?, ?it/s]"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "4effc6449f0a40dfbf1c23b82bfdaa5c"
}
},
"metadata": {},
"output_type": "display_data",
"jetTransient": {
"display_id": null
}
}
],
"execution_count": 10
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2026-01-06T01:46:15.258049900Z",
"start_time": "2026-01-06T01:46:04.200209200Z"
}
},
"cell_type": "code",
"source": [
"df1 = pd.DataFrame(all_bill_data)\n",
"df1.to_excel(\"D:\\Idea Project\\F6+宜搭+其它(1)\\张阳脚本\\文件输出\\稻田工单信息.xlsx\")"
],
"id": "cd6a4b2fd5b30cd1",
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"<>:2: SyntaxWarning: invalid escape sequence '\\I'\n",
"<>:2: SyntaxWarning: invalid escape sequence '\\I'\n",
"C:\\Users\\hp_z66\\AppData\\Local\\Temp\\ipykernel_3692\\374022918.py:2: SyntaxWarning: invalid escape sequence '\\I'\n",
" df1.to_excel(\"D:\\Idea Project\\F6+宜搭+其它(1)\\张阳脚本\\文件输出\\稻田工单信息.xlsx\")\n"
]
}
],
"execution_count": 11
},
{
"metadata": {},
"cell_type": "markdown",
"source": "# 明细数据",
"id": "f1cd6158da5b6b95"
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2026-01-06T07:03:02.964073Z",
"start_time": "2026-01-06T05:40:38.583462300Z"
}
},
"cell_type": "code",
"source": [
"import requests\n",
"\n",
"cookies = {\n",
" 'feehi_session': '695c609649781',\n",
"}\n",
"\n",
"headers = {\n",
" 'accept': '*/*',\n",
" 'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',\n",
" 'authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOjMwMTI2MDEwNTE1MjgxMDAwMSwic2NvcGVzIjoiYXQiLCJpc3MiOiJzaHVpZGFvLnNlcnZlciIsImF1ZCI6InNodWlkYW8uY2xpZW50IiwianRpIjoiZTkzNTUzIiwiaWF0IjoxNzY3NjYyNjMyLjUzMzA1MiwibmJmIjoxNzY3NjYyNjMyLjUzMzA1MiwiZXhwIjoxNzY3NzQ5MDMyLjUzMzA1Mn0.hOQXKo5BgSf-oPNCRhdHtiDUkHNBBagE5YULNRmKLtM',\n",
" 'origin': 'https://daotian.shuidao.com',\n",
" 'priority': 'u=1, i',\n",
" 'referer': 'https://daotian.shuidao.com/',\n",
" 'sec-ch-ua': '\"Microsoft Edge\";v=\"143\", \"Chromium\";v=\"143\", \"Not A(Brand\";v=\"24\"',\n",
" 'sec-ch-ua-mobile': '?0',\n",
" 'sec-ch-ua-platform': '\"Windows\"',\n",
" 'sec-fetch-dest': 'empty',\n",
" 'sec-fetch-mode': 'cors',\n",
" 'sec-fetch-site': 'same-site',\n",
" 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 Edg/143.0.0.0',\n",
" # 'cookie': 'feehi_session=695c609649781',\n",
"}\n",
"\n",
"df1 = pd.read_excel(\"D:\\Idea Project\\F6+宜搭+其它(1)\\张阳脚本\\文件输出\\稻田工单信息.xlsx\", sheet_name=0)\n",
"\n",
"bill_detail_list =[]\n",
"# start_index = 2055\n",
"for index, row in tqdm(df1.iterrows(),total=len(df1)):\n",
" params = {\n",
" 'intention_id': row[\"_id\"],\n",
" 'rtick': '1767664096987',\n",
" }\n",
" try:\n",
" response = requests.get(\n",
" 'https://api.shuidao.com/daotian_web/maintain/intention-item-list',\n",
" params=params,\n",
" cookies=cookies,\n",
" headers=headers,\n",
" )\n",
" bill_detail_list.extend(response.json().get(\"res\").get(\"list\"))\n",
" time.sleep(0.1)\n",
" except Exception as e:\n",
" print(e)\n",
" pass\n",
"\n",
"df2 = pd.DataFrame(bill_detail_list)\n",
"\n",
"df2.to_excel(\"D:\\Idea Project\\F6+宜搭+其它(1)\\张阳脚本\\文件输出\\稻田工单明细信息1.xlsx\")\n",
"\n"
],
"id": "4fa2e08ed6bfb614",
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"<>:24: SyntaxWarning: invalid escape sequence '\\I'\n",
"<>:48: SyntaxWarning: invalid escape sequence '\\I'\n",
"<>:24: SyntaxWarning: invalid escape sequence '\\I'\n",
"<>:48: SyntaxWarning: invalid escape sequence '\\I'\n",
"C:\\Users\\hp_z66\\AppData\\Local\\Temp\\ipykernel_3692\\3065781067.py:24: SyntaxWarning: invalid escape sequence '\\I'\n",
" df1 = pd.read_excel(\"D:\\Idea Project\\F6+宜搭+其它(1)\\张阳脚本\\文件输出\\稻田工单信息.xlsx\", sheet_name=0)\n",
"C:\\Users\\hp_z66\\AppData\\Local\\Temp\\ipykernel_3692\\3065781067.py:48: SyntaxWarning: invalid escape sequence '\\I'\n",
" df2.to_excel(\"D:\\Idea Project\\F6+宜搭+其它(1)\\张阳脚本\\文件输出\\稻田工单明细信息1.xlsx\")\n"
]
},
{
"data": {
"text/plain": [
" 0%| | 0/9295 [00:00<?, ?it/s]"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "9cdf16f7030848218582f41071d2fec0"
}
},
"metadata": {},
"output_type": "display_data",
"jetTransient": {
"display_id": null
}
}
],
"execution_count": 22
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2026-01-06T02:28:33.164475100Z",
"start_time": "2026-01-06T02:28:16.357244200Z"
}
},
"cell_type": "code",
"source": [
"df2 = pd.DataFrame(bill_detail_list)\n",
"\n",
"df2.to_excel(\"D:\\Idea Project\\F6+宜搭+其它(1)\\张阳脚本\\文件输出\\稻田工单明细信息.xlsx\")"
],
"id": "c7f67a5d2a9e0845",
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"<>:3: SyntaxWarning: invalid escape sequence '\\I'\n",
"<>:3: SyntaxWarning: invalid escape sequence '\\I'\n",
"C:\\Users\\hp_z66\\AppData\\Local\\Temp\\ipykernel_3692\\3122899901.py:3: SyntaxWarning: invalid escape sequence '\\I'\n",
" df2.to_excel(\"D:\\Idea Project\\F6+宜搭+其它(1)\\张阳脚本\\文件输出\\稻田工单明细信息.xlsx\")\n"
]
}
],
"execution_count": 16
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 5
}