25 lines
1.8 KiB
Python
25 lines
1.8 KiB
Python
import pandas as pd
|
|
import requests
|
|
import json
|
|
import xlrd
|
|
from pprint import pprint
|
|
cookies_str = 'f6-ids-goodsSESSIONID=af571e86-4e73-4006-9c8a-255f6977165c; erpLanguage=zh-CN; tmall=false; unp=10546443564007523766; _up=-NillNN-qyBEJ--t3vnSknvoOFt6yfeJtM4A1X8_WuBYVPLGoZ_QjaZJ9Q3d-WrAAGgt60MgQHajHWBHMKKxj0CuWypi1JgKCFP1EPEk-HbqFPoUqI4i0wsJ9_JRv-ZNHu3M-GTZ25y3EXOrq-tRiesdlVTAORVprEj9-knQgcH6NGI.; sensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%2215605564149906554899%22%2C%22first_id%22%3A%2217e08ece80f53a-0448dc86383ae5-3e604809-1327104-17e08ece81094e%22%2C%22props%22%3A%7B%22%24latest_traffic_source_type%22%3A%22%E7%9B%B4%E6%8E%A5%E6%B5%81%E9%87%8F%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC_%E7%9B%B4%E6%8E%A5%E6%89%93%E5%BC%80%22%2C%22%24latest_referrer%22%3A%22https%3A%2F%2Fyunxiu.f6car.com%2Ferp%2Fview%2Findex.html%22%7D%2C%22%24device_id%22%3A%2217e08ece80f53a-0448dc86383ae5-3e604809-1327104-17e08ece81094e%22%7D; prodOrg=11240984669917926035'
|
|
|
|
cookies_str = cookies_str.encode('utf-8').decode('latin-1')
|
|
|
|
cookie_dict = {item.split('=')[0]: item.split('=')[1]
|
|
for item in cookies_str.split('; ')}
|
|
|
|
headers = {
|
|
'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',
|
|
"Content-Type": "application/json",
|
|
'origin': 'https://yunxiu.f6car.cn'
|
|
}
|
|
url = 'https://ids-goods.f6car.com/f6-ids-goods/part/deletePartInfo'
|
|
|
|
data = pd.read_excel(r"C:\Users\admin\Desktop\新建XLS 工作表(1).xls", sheet_name='Sheet5')
|
|
for a in data.index:
|
|
infoId =data.loc[a,"材料长码"]
|
|
json={"infoIds":[str(infoId)],"idOwnOrg":"11240984669917926035"}
|
|
resquest = requests.post(url,cookies=cookie_dict,json=json)
|
|
print(resquest,json) |