
jagan1
Members-
Số lượng nội dung
3 -
Đã tham gia
-
Lần ghé thăm cuối
Cộng đồng
0 Neutral-
Chạy trên code thì lúc được lúc không, mình chưa hiểu vấn đề ở đây là bị gì. Sáng nay mình vừa chạy lại trên autoit, dùng cookie cũ mà vẫn get dc full.
-
jagan1 đã bắt đầu đang theo dõi [Help] Request lấy thông tin sản phẩm trên shopee
-
Tình hình là mình request lấy thông tin sản phẩm với api của shopee (https://shopee.vn/api/v2/item/get?shopid=204574220&itemid=7729982955) bằng autoit thì thông tin trả về ở những mục "name" sẽ bị cắt mất 5 kí tự cuối thế nhưng khi request bằng chrome đã bật ẩn danh, chưa login shopee (https://reqbin.com/) thì lại hiển thị đầy đủ mặc dù tất cả headers, cookie, referer truyền vào là giống 100% phần code autoit. - Đây là code autoit #RequireAdmin #include <_HttpRequest.au3> $sHeaders = "Host: shopee.vn|User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0|Accept: */*|Accept-Language: en-US,en;q=0.5|Accept-Encoding: gzip, deflate, br|X-Shopee-Language: vi|X-Requested-With: XMLHttpRequest|X-API-SOURCE: pc|If-None-Match-: 55b03-abb5f0333d6583c61ad43ff7abfb305d|DNT: 1|Connection: keep-alive" $sReferer = "https://shopee.vn/-M%C3%A3-ELMS05-gi%E1%BA%A3m-5-%C4%91%C6%A1n-300k-%F0%9F%8E%81Laptop-Gtab-Ultrabook-si%C3%AAu-m%E1%BB%8Fng-nh%E1%BA%B9-Pin-tr%C3%A2u-i.204574220.7729982955" $sCookie = 'SPC_R_T_ID="YM+hzUs0Ew7rPM0NKpqMvprxTzEoxy5SQ6/ATbG29Lvu3J9Go0oMHgnu4ulbsfv+B+DpCugGKnUhsPmfiFJLT/g5yKK5dAfnoEyVMjM5/bs="; SPC_IA=-1; SPC_EC=-; SPC_F=heWD8YDPcAvWfytortydk75Rlhzp2V1A; REC_T_ID=0755783e-a965-11eb-858b-3c15fb7e9ea1; SPC_T_ID="YM+hzUs0Ew7rPM0NKpqMvprxTzEoxy5SQ6/ATbG29Lvu3J9Go0oMHgnu4ulbsfv+B+DpCugGKnUhsPmfiFJLT/g5yKK5dAfnoEyVMjM5/bs="; SPC_SI=mall.UKjH2NQZdsHzoRCSqRW3zVezJlw1xSed; SPC_R_T_IV="CNNi43CJ1mANDIbG/iaFhA=="; SPC_U=-; SPC_T_IV="CNNi43CJ1mANDIbG/iaFhA=="; REC_T_ID=07594fe1-a965-11eb-acc3-10c17297d5e7; G_ENABLED_IDPS=google; csrftoken=5gK4W8bSEaPN5yfm0B9rUPJ5GgVGuehi' $sRq = _HttpRequest(2, "https://shopee.vn/api/v2/item/get?shopid=204574220&itemid=7729982955", "", $sCookie, $sReferer, $sHeaders) ClipPut($sRq) - Mình đã thử luôn bên python và kết quả vẫn bị thiếu như autoit import requests, pyperclip from requests.structures import CaseInsensitiveDict url = "https://shopee.vn/api/v2/item/get?shopid=204574220&itemid=7729982955" headers = CaseInsensitiveDict() headers["Host"] = "shopee.vn" headers["User-Agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0" headers["Accept"] = "*/*" headers["Accept-Language"] = "en-US,en;q=0.5" headers["Accept-Encoding"] = "gzip, deflate, br" headers["Referer"] = "https://shopee.vn/-M%C3%A3-ELMS05-gi%E1%BA%A3m-5-%C4%91%C6%A1n-300k-%F0%9F%8E%81Laptop-Gtab-Ultrabook-si%C3%AAu-m%E1%BB%8Fng-nh%E1%BA%B9-Pin-tr%C3%A2u-i.204574220.7729982955" headers["X-Shopee-Language"] = "vi" headers["X-Requested-With"] = "XMLHttpRequest" headers["X-API-SOURCE"] = "pc" headers["If-None-Match-"] = "55b03-abb5f0333d6583c61ad43ff7abfb305d" headers["DNT"] = "1" headers["Connection"] = "keep-alive" headers["Cookie"] = 'SPC_R_T_ID="YM+hzUs0Ew7rPM0NKpqMvprxTzEoxy5SQ6/ATbG29Lvu3J9Go0oMHgnu4ulbsfv+B+DpCugGKnUhsPmfiFJLT/g5yKK5dAfnoEyVMjM5/bs="; SPC_IA=-1; SPC_EC=-; SPC_F=heWD8YDPcAvWfytortydk75Rlhzp2V1A; REC_T_ID=0755783e-a965-11eb-858b-3c15fb7e9ea1; SPC_T_ID="YM+hzUs0Ew7rPM0NKpqMvprxTzEoxy5SQ6/ATbG29Lvu3J9Go0oMHgnu4ulbsfv+B+DpCugGKnUhsPmfiFJLT/g5yKK5dAfnoEyVMjM5/bs="; SPC_SI=mall.UKjH2NQZdsHzoRCSqRW3zVezJlw1xSed; SPC_R_T_IV="CNNi43CJ1mANDIbG/iaFhA=="; SPC_U=-; SPC_T_IV="CNNi43CJ1mANDIbG/iaFhA=="; REC_T_ID=07594fe1-a965-11eb-acc3-10c17297d5e7; G_ENABLED_IDPS=google; csrftoken=5gK4W8bSEaPN5yfm0B9rUPJ5GgVGuehi' resp = requests.get(url, headers=headers) pyperclip.copy(str(resp.content.decode("utf8"))) # Tương tự như ClipPut() của AutoIt Bài viết đầu tiên của mình trong forum, mong có cao nhân giúp đỡ. Mình cảm ơn rất nhiều!
-
hướng dẫn _HttpRequest: Đăng nhập trang shopee.vn
jagan1 replied to Huân Hoàng's chủ đề in Chia sẻ code và UDF
Thanks Huân Hoàng!- 178 trả lời
-
- autoit
- shopee login
-
(và 5 tags nữa)
Tagged with: