requests post 파라미터 에러
조회수 578회
with requests.ssesion() as s: 문으로
로그인후 세션을 받아서 쿠키를 설정한 상태입니다.
다른 페이지(get, json) 출력은 잘 되는데요.
아래 페이지의 경우 post요청을 하면 에러가 납니다.
어디가 문젤까요?
url='https://www.esmplus.com/Sell/SingleGoodsMng/GetSingleGoodsList?_dc=1629816933189'
s.headers = {
'Accept': '*/*',
'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'ko,en-US;q=0.9,en;q=0.8,fr;q=0.7',
'Connection': 'keep-alive',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Cookie':'_ga=GA1.2.1292533393.162***************************',
'Host': 'www.esmplus.com',
'Origin': 'https://www.esmplus.com',
'Referer': 'https://www.esmplus.com/Sell/SingleGoodsMng?menuCode=TDM396',
'sec-ch-ua': '"Chromium";v="92", " Not A;Brand";v="99", "Google Chrome";v="92"',
'sec-ch-ua-mobile': '?0',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'same-origin',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36',
'X-Requested-With': 'XMLHttpRequest'
}
data = {
'paramsData':{
"Keyword":"밸브",
"SiteId":"1",
"CategorySiteId":1,
"CategoryCode":"641009",
"CategoryLevel":"S",
"TransPolicyNo":502170,
"StatusCode":"",
"SearchDateType":1,
"SearchStartDate":"",
"SearchEndDate":"",
"SellerId":"rmfrmffla",
"SellerSiteId":"1",
"StockQty":10,
"SellPeriod":15,
"DiscountUseIs":1,
"DeliveryFeeApplyType":2,
"OptAddDeliveryType":1,
"OptSelUseIs":2,
"PremiumEnd":3,
"PremiumPlusEnd":30,
"FocusEnd":7,
"FocusPlusEnd":30,
"GoodsIdType":"S",
"GoodsIds":"",
"ShopCateReg":1,
"IsTPLUse":"TL",
"SellMinPrice":"",
"SellMaxPrice":"",
"OrderByType":11,
"GroupOrderByType":1,
"IsGroupUse":"Y",
"IsApplyEpin":"1",
"IsConvertSingleGoods":"N" },
'page': 1,
'start': 0,
'limit': 20,
'group' : [{"property":"SingleGoodsNo","direction":"ASC"}]
}
res = s.post(url,data=data, headers = headeres).json()
print(res)
{'Result': None, 'ResultBase': {'ReturnErrorMessage': '잘못된 JSON 기본 형식: Keyword.', 'ReturnErrorCode': '999999', 'ReturnDomain': 'A', 'ActionCode': 'L'}, 'ExceptionMessage': '알수없는 에러가 발생 했습니다.'}
아래 추가로 이미지 첨부했습니다. 리퀘스트 헤더에 쿠키는 너무 길어서 화면이 잘렸습니다. 4번째 프리뷰 이미지에 보시면 json형식으로 데이터가 출력이 잘 됩니다.
-
(•́ ✖ •̀)
알 수 없는 사용자
1 답변
-
존재하지 않는 페이지라고 나옵니다만..
댓글 입력