{ "cells": [ { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import requests\n", "\n", "\"\"\" 处理流程开始 \"\"\"\n", "cookies_str = 'memberSESSIONID=7b034fdc-7edd-45a5-a615-ad0033608b6e; sensorsdata2015jssdkcross={\"distinct_id\":\"10691192243902595917\",\"first_id\":\"1750b4690af1f6-089dd3a4874eb8-3d634f03-1327104-1750b4690b09d0\",\"props\":{\"$latest_traffic_source_type\":\"直接流量\",\"$latest_search_keyword\":\"未取到值_直接打开\",\"$latest_referrer\":\"\"},\"$device_id\":\"1750b4690af1f6-089dd3a4874eb8-3d634f03-1327104-1750b4690b09d0\"}; gr_user_id=408fef1a-77ed-4e74-8f1e-31dde3446f2e; prodOrg=11240984669917188035; unp=15632739166222045268; un=15632739166222045268; _up=-NillNN-qyBEJ--t3vnSknvoOF55zvOKs8QE1X09WOVdUvTDoZHQjaZJ9Q3d-WrAAGgt60MgQHajHWBHMKKxj0CuWypi1JgKCFP1EPEk-HbrE_QSqoIn0wAO-_RRv-ZNHu3M-GTc2JuzEnShr-tTi-kYkFLGPBVnrEj9nRXn_Km3UDc.; tmall=false; sensorsdata2015jssdkcross={\"distinct_id\":\"15632739166222045268\",\"first_id\":\"1750b4690af1f6-089dd3a4874eb8-3d634f03-1327104-1750b4690b09d0\",\"props\":{\"$latest_traffic_source_type\":\"直接流量\",\"$latest_search_keyword\":\"未取到值_直接打开\",\"$latest_referrer\":\"\"},\"$device_id\":\"1750b4690af1f6-089dd3a4874eb8-3d634f03-1327104-1750b4690b09d0\"}'\n", "\n", "cookies_str = cookies_str.encode('utf-8').decode('latin-1')\n", "\n", "cookie_dict = {item.split('=')[0]: item.split('=')[1]\n", " for item in cookies_str.split('; ')}\n", "\n", "headers = {\n", " 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36 Edg/95.0.1020.40',\n", " \"Content-Type\": \"application/json\",\n", " 'origin': 'https://yunxiu.f6car.cn'\n", "}\n", "# 获取id\n", "api = f'https://yunxiu.f6car.cn/member/feedback/list?searchTab=2&billIdOwnOrgList=&pageSize=100&pageNo=1'\n", "\n", "res = requests.get(api, headers=headers,cookies=cookie_dict)\n", "\n", "res_new = res.json()\n", "\n", "for i in range(0,100):\n", " a_new = res_new['data']['data'][i]['id']\n" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'10474413'" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "res_new['data']['data'][0]['id']" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "167764198600\n" ] } ], "source": [ "import time\n", "mkt = round(time.time())\n", "print(str(mkt)+\"00\")" ] }, { "cell_type": "code", "execution_count": 38, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1677642600000\n" ] } ], "source": [ "mkt = str(round(time.time()))[0:8]+\"00000\"\n", "print(str(mkt))" ] }, { "cell_type": "code", "execution_count": 46, "metadata": {}, "outputs": [], "source": [ "# -- coding: utf-8 --\n", "api = 'https://yunxiu.f6car.cn/member/feedback/completeAll'\n", "\n", "a_new = res_new['data']['data'][0]['id']\n", "# 时间转化\n", "mkt = str(round(time.time()))[0:8]+\"00000\"\n", "\n", "data= {\n", " \"feedbackId\": a_new,\n", " \"feedbackBaseParam\": {\n", " \"id\": a_new,\n", " \"scheduleDate\": mkt,\n", " \"isEffective\": 1\n", " },\n", " \"feedbackProcessLogParam\": 'null',\n", " \"feedbackQuestionResultParams\": [\n", " {\n", " \"feedbackId\": a_new,\n", " \"questionId\": 101942,\n", " \"questionContent\": \"服务态度\",\n", " \"questionType\": 0\n", " },\n", " {\n", " \"feedbackId\": a_new,\n", " \"questionId\": 101942,\n", " \"questionContent\": \"施工质量\",\n", " \"questionType\": 0\n", " },\n", " {\n", " \"feedbackId\": a_new,\n", " \"questionId\": 101942,\n", " \"questionContent\": \"店面环境\",\n", " \"questionType\": 0\n", " },\n", " {\n", " \"feedbackId\": a_new,\n", " \"questionId\": 101942,\n", " \"questionContent\": \"对技师服务水平\",\n", " \"questionType\": 0\n", " },\n", " {\n", " \"feedbackId\": a_new,\n", " \"questionId\": 101942,\n", " \"questionContent\": \"如果您的亲友也需要 {业务分类名称} 项目,您是否愿意推荐 {门店简称} ?\",\n", " \"questionType\": 0\n", " }\n", " ]\n", "}\n", "res = requests.post(api, headers=headers,cookies=cookie_dict,json=data)" ] }, { "cell_type": "code", "execution_count": 48, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "''" ] }, "execution_count": 48, "metadata": {}, "output_type": "execute_result" } ], "source": [ "res.text" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "{\n", " \"feedbackId\": \"10474413\",\n", " \"feedbackBaseParam\": {\n", " \"id\": \"10474413\",\n", " \"scheduleDate\": 1639958400000,\n", " \"isEffective\": 1\n", " },\n", " \"feedbackProcessLogParam\": null,\n", " \"feedbackQuestionResultParams\": [\n", " {\n", " \"feedbackId\": \"10474413\",\n", " \"questionId\": 101942,\n", " \"questionContent\": \"服务态度\",\n", " \"questionType\": 0\n", " },\n", " {\n", " \"feedbackId\": \"10474413\",\n", " \"questionId\": 101942,\n", " \"questionContent\": \"施工质量\",\n", " \"questionType\": 0\n", " },\n", " {\n", " \"feedbackId\": \"10474413\",\n", " \"questionId\": 101942,\n", " \"questionContent\": \"店面环境\",\n", " \"questionType\": 0\n", " },\n", " {\n", " \"feedbackId\": \"10474413\",\n", " \"questionId\": 101942,\n", " \"questionContent\": \"对技师服务水平\",\n", " \"questionType\": 1\n", " },\n", " {\n", " \"feedbackId\": \"10474413\",\n", " \"questionId\": 101942,\n", " \"questionContent\": \"如果您的亲友也需要 {业务分类名称} 项目,您是否愿意推荐 {门店简称} ?\",\n", " \"questionType\": 2\n", " }\n", " ]\n", "}" ] } ], "metadata": { "kernelspec": { "display_name": "F6processing", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.4" }, "orig_nbformat": 4, "vscode": { "interpreter": { "hash": "f83923c7d0b4d2e003073efbd633777fa3fd66b7578149f24f67f4796b9b3ac4" } } }, "nbformat": 4, "nbformat_minor": 2 }