├── LICENSE ├── README.md ├── lazada指定商品评论收集spider ├── __pycache__ │ └── ua_info.cpython-312.pyc ├── lazada_targeting_products_comment_spider.py ├── readme.txt └── ua_info.py ├── youtube_video_download ├── cookies.txt ├── readme.md ├── result.json └── youtube_video_get.py ├── 京东--关键词搜索商品信息采集 ├── JD_spider.py ├── area_info.config ├── jd.html ├── jd_product.csv └── readme.txt ├── 百度翻译spider ├── 1.txt ├── readme.txt ├── ua_info.py ├── 百度translate.py └── 百度翻译参数破译.js ├── 网易有道翻译spider ├── readme.txt ├── run.py ├── 网易翻译response破译.js ├── 网易翻译sign参数.js └── 网易翻译接口subprocess版.py ├── 虾皮shopee指定商品评论收集scrapy版(新加坡) └── shopee_remark │ ├── scrapy.cfg │ ├── shopee_remark │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-312.pyc │ │ ├── items.cpython-312.pyc │ │ ├── pipelines.cpython-312.pyc │ │ └── settings.cpython-312.pyc │ ├── items.py │ ├── middlewares.py │ ├── pipelines.py │ ├── settings.py │ └── spiders │ │ ├── __init__.py │ │ ├── __pycache__ │ │ ├── __init__.cpython-312.pyc │ │ ├── run.cpython-312.pyc │ │ └── shopee_remark_spider.cpython-312.pyc │ │ ├── run.py │ │ └── shopee_remark_spider.py │ └── shopee_remarks.csv └── 虾皮shopee指定商品评论收集spider ├── readme.txt ├── shopee_targeting_products_comment_spider.py └── ua_info.py /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | In jurisdictions that recognize copyright laws, the author or authors 4 | of this software dedicate any and all copyright interest in the 5 | software to the public domain. We make this dedication for the benefit 6 | of the public at large and to the detriment of our heirs and 7 | successors. We intend this dedication to be an overt act of 8 | relinquishment in perpetuity of all present and future rights to this 9 | software under copyright law. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 12 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 13 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 14 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 15 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 16 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 17 | OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | For more information, please refer to 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 使用说明📕 2 | 包含网易,百度,国内电商,国外电商平台等等一些爬虫及逆向案例的代码分享,本人空闲时会持续更新🚀 3 | 4 | 本项目完全用于学习目的,无任何商业用途, 5 | 6 | 代码仅供参考,本项目仅供学习和研究使用,仅限于学习交流, 7 | 8 | 切勿用于商业用途.如有侵权,请及时联系作者删除 9 | 10 | 11 | 如有小伙伴,有更好的建议或不明白的部分,欢迎随时联系我进行讨论📫📧 12 | 13 | 14 | ‘pycekim333@gmail.com’ 15 | 16 | ‘pycekim@163.com’ 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | ##Instructions for use✈ 26 | 27 | Code sharing of web crawlers and reverse engineering cases, including Netease, Baidu, domestic e-commerce platforms, foreign e-commerce platforms, etc. I will continue to update them during my free time 28 | This project is solely for learning purposes and has no commercial use, 29 | 30 | The code is for reference only, and this project is for learning and research purposes only, limited to learning and communication, 31 | 32 | Do not use for commercial purposes. If there is any infringement, please contact the author promptly to remove it 33 | 34 | If any friends have better suggestions or unclear parts, please feel free to contact me at any time for discussion🛸 35 | 36 | 37 | -------------------------------------------------------------------------------- /lazada指定商品评论收集spider/__pycache__/ua_info.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Prycekim/python_spider_idea_learn_share/4e34386524b8703752a0c51f4888e4e1ef04194f/lazada指定商品评论收集spider/__pycache__/ua_info.cpython-312.pyc -------------------------------------------------------------------------------- /lazada指定商品评论收集spider/lazada_targeting_products_comment_spider.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import re 3 | import time 4 | import random 5 | from ua_info import ua_list 6 | import pandas as pd 7 | import json 8 | import os 9 | 10 | # 定义一个spider类 11 | class shopee_Spider: 12 | # 初始化 13 | # 定义初始页面url 14 | def __init__(self,page_num): 15 | self.url = 'https://my.lazada.com.my/pdp/review/getReviewList?itemId=4070686268&pageSize=5&filter=0&sort=0&pageNo={}' 16 | #用户要获取的页数 17 | self.page_num = page_num 18 | 19 | 20 | 21 | 22 | # 请求函数 23 | def get_response(self,url): 24 | headers = {'User-Agent':random.choice(ua_list)} 25 | response = requests.get(url, headers=headers,verify=False) 26 | if response.status_code == 200: 27 | try: 28 | data = json.loads(response.text) 29 | self.parse_response(data) 30 | except: 31 | print(response.text) 32 | else: 33 | print("请求失败,状态码:", response.status_code) 34 | return response.status_code 35 | 36 | 37 | 38 | # 解析函数---JSON---数据存储进csv 39 | def parse_response(self,response_data): 40 | #创建一个空的容器 41 | lazada_data = [] 42 | #提取评论中需要的部分 43 | res_lst = response_data['model']['items'] 44 | #循环遍历 45 | for res_target in res_lst: 46 | images_lst = [] 47 | 48 | #itemsid 49 | itemId = res_target['itemId'] 50 | #评论类型 51 | reviewType = res_target['reviewType'] 52 | #购买时间 53 | boughtDate = res_target['boughtDate'] 54 | #状态 55 | reviewStatus = res_target['reviewStatus'] 56 | #评论内容 57 | reviewContent = res_target['reviewContent'] 58 | #评论时间 59 | reviewTime = res_target['reviewTime'] 60 | #图片 61 | for i in res_target['images']: 62 | images_lst.append(i['url']) 63 | 64 | images = images_lst 65 | #买家id 66 | buyerId = res_target['buyerId'] 67 | #买家名字 68 | buyerName = res_target['buyerName'] 69 | #skuid 70 | skuId = res_target['skuId'] 71 | #sku信息 72 | skuInfo = res_target['skuInfo'] 73 | #等级 74 | rating = res_target['rating'] 75 | 76 | lazada_data.append([itemId, reviewType, boughtDate, reviewStatus,reviewContent,reviewTime,images,buyerId,buyerName,skuId,skuInfo,rating]) 77 | 78 | 79 | new_data = pd.DataFrame(lazada_data, columns=['itemsid', '评论类型', '购买时间', '状态', '评论内容','评论时间','图片','买家id','买家名字','skuid','sku信息','等级']) 80 | 81 | print(new_data) 82 | 83 | self.save_data(new_data) 84 | 85 | #存储函数 86 | def save_data(self,new_data): 87 | print(new_data) 88 | 89 | 90 | 91 | # 主函数 92 | def run(self): 93 | page_num = 0 94 | #拼接页数 95 | for self.page in range(1, self.page_num + 1): 96 | page_num = page_num + 1 97 | #拼接生成url 98 | print(page_num) 99 | url = self.url.format(str(page_num)) 100 | print(url) 101 | #启动请求函数 102 | self.get_response(url) 103 | time.sleep(1) 104 | 105 | print('执行完毕') 106 | 107 | 108 | 109 | 110 | # 以脚本方式启动 111 | if __name__ == '__main__': 112 | print("输入您想要获取几页评论:") 113 | page_num = input() 114 | try: 115 | #传参:id/页数,然后启动爬虫 116 | spider = shopee_Spider(int(page_num)) 117 | spider.run() 118 | except Exception as e: 119 | print("错误:",e) 120 | 121 | print('程序执行完毕') 122 | -------------------------------------------------------------------------------- /lazada指定商品评论收集spider/readme.txt: -------------------------------------------------------------------------------- 1 | ## 使用说明 2 | 3 | 本程序是对跨境电商平台lazada指定商品页面评论爬虫学习, 4 | 由于lazada和shopee的评论api接口相似,且lazada对请求IP要求较高,故本程序代码部分相对简陋,目的是学习,参考 5 | 如有详细需求,可以参考’shopee指定商品评论收集’的代码部分 6 | 7 | 代码仅供参考,本项目仅供学习和研究使用,仅限于学习交流,切勿用于商业用途,如有侵权,请及时联系作者删除 8 | 9 | 如有小伙伴,有更好的建议或不明白的部分,欢迎随时联系我进行讨论 10 | 11 | -------------------------------------------------------------------------------- /lazada指定商品评论收集spider/ua_info.py: -------------------------------------------------------------------------------- 1 | ua_list = [ 2 | 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Maxthon 2.0', 3 | 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_0) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11', 4 | 'User-Agent:Opera/9.80 (Windows NT 6.1; U; en) Presto/2.8.131 Version/11.11', 5 | 'Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1', 6 | 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)', 7 | 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50', 8 | 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0', 9 | 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1', 10 | 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1', 11 | 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0.1) Gecko/20100101 Firefox/4.0.1', 12 | ] -------------------------------------------------------------------------------- /youtube_video_download/cookies.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /youtube_video_download/readme.md: -------------------------------------------------------------------------------- 1 | 本代码是google开放api和yt_dlp库结合起来实现的,youtube视频自动化批量搬运 2 | 3 | 你需要去api官网自助申请好api key,带着你申请的apikey发送请求拿到每条视频的id,拼接成完整视频地址 4 | 5 | 再用完整视频地址使用yt_dlp库去下载到你指定的文件夹 6 | 7 | https://console.cloud.google.com/apis/api/youtube.googleapis.com/metrics 8 | 9 | ![image](https://github.com/user-attachments/assets/84633642-fc90-4a45-8175-10ee2ae6e2ae) 10 | 11 | api文档地址 12 | 13 | https://developers.google.com/youtube/v3/docs/search/list?hl=zh-cn 14 | 15 | 你可以按照文档里提供的参数,自由定制要获取的视频类型 16 | 17 | 另外你需要用浏览器的get cookie插件把cookie粘贴到cookie.txt文件中 18 | 19 | ![image](https://github.com/user-attachments/assets/b330267c-d47d-4f5b-9455-733500fb60be) 20 | 21 | 22 | ![image](https://github.com/user-attachments/assets/9658be11-25ed-495b-b22f-a822fb8bcea1) 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /youtube_video_download/result.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "kind": "youtube#searchResult", 4 | "etag": "89PZqHl-BuPG6sGN8bg-TglsW58", 5 | "id": { 6 | "kind": "youtube#video", 7 | "videoId": "2S61zjZ9D_g" 8 | }, 9 | "snippet": { 10 | "publishedAt": "2024-09-03T03:35:43Z", 11 | "channelId": "UCgske0zWcoiTeheCsZUbXZA", 12 | "title": "小米汽车APP推送1.6.0版本,新增用户反馈记录,主打一个听劝", 13 | "description": "小米汽车APP推送1.6.0版本,新增用户反馈记录,主打一个听劝#小米su7 #小米 #小米汽车 #2024 #automobile #汽车 #熱門 #car ...", 14 | "thumbnails": { 15 | "default": { 16 | "url": "https://i.ytimg.com/vi/2S61zjZ9D_g/default.jpg", 17 | "width": 120, 18 | "height": 90 19 | }, 20 | "medium": { 21 | "url": "https://i.ytimg.com/vi/2S61zjZ9D_g/mqdefault.jpg", 22 | "width": 320, 23 | "height": 180 24 | }, 25 | "high": { 26 | "url": "https://i.ytimg.com/vi/2S61zjZ9D_g/hqdefault.jpg", 27 | "width": 480, 28 | "height": 360 29 | } 30 | }, 31 | "channelTitle": "随心车生活-小米SU7车主", 32 | "liveBroadcastContent": "none", 33 | "publishTime": "2024-09-03T03:35:43Z" 34 | } 35 | }, 36 | { 37 | "kind": "youtube#searchResult", 38 | "etag": "1Qa2dl-wOSLp6Icqb3Gy7d5EML8", 39 | "id": { 40 | "kind": "youtube#video", 41 | "videoId": "AmWpBIzmhMg" 42 | }, 43 | "snippet": { 44 | "publishedAt": "2024-09-03T02:00:05Z", 45 | "channelId": "UCu88RFxP8t2gfboHNwpzKjQ", 46 | "title": "超详细测试小米SU7", 47 | "description": "超详细测试小米SU7.", 48 | "thumbnails": { 49 | "default": { 50 | "url": "https://i.ytimg.com/vi/AmWpBIzmhMg/default.jpg", 51 | "width": 120, 52 | "height": 90 53 | }, 54 | "medium": { 55 | "url": "https://i.ytimg.com/vi/AmWpBIzmhMg/mqdefault.jpg", 56 | "width": 320, 57 | "height": 180 58 | }, 59 | "high": { 60 | "url": "https://i.ytimg.com/vi/AmWpBIzmhMg/hqdefault.jpg", 61 | "width": 480, 62 | "height": 360 63 | } 64 | }, 65 | "channelTitle": "新蚂蚁车评", 66 | "liveBroadcastContent": "none", 67 | "publishTime": "2024-09-03T02:00:05Z" 68 | } 69 | }, 70 | { 71 | "kind": "youtube#searchResult", 72 | "etag": "MYUzb0JDiB8sJZlkDxjNS3ei9PA", 73 | "id": { 74 | "kind": "youtube#video", 75 | "videoId": "B-4SIig7sh8" 76 | }, 77 | "snippet": { 78 | "publishedAt": "2024-09-03T00:27:57Z", 79 | "channelId": "UCPzYCeczs7nTLefOJtBWhpw", 80 | "title": "7月广州销量:小米SU7入轿车榜TOP 4 ,AION“双雄”重回榜首", 81 | "description": "7月广州销量:小米SU7入轿车榜TOP 4 ,AION“双雄”重回榜首 Tomorrow,汽车,销量,轿车.", 82 | "thumbnails": { 83 | "default": { 84 | "url": "https://i.ytimg.com/vi/B-4SIig7sh8/default.jpg", 85 | "width": 120, 86 | "height": 90 87 | }, 88 | "medium": { 89 | "url": "https://i.ytimg.com/vi/B-4SIig7sh8/mqdefault.jpg", 90 | "width": 320, 91 | "height": 180 92 | }, 93 | "high": { 94 | "url": "https://i.ytimg.com/vi/B-4SIig7sh8/hqdefault.jpg", 95 | "width": 480, 96 | "height": 360 97 | } 98 | }, 99 | "channelTitle": "Kung fu car", 100 | "liveBroadcastContent": "none", 101 | "publishTime": "2024-09-03T00:27:57Z" 102 | } 103 | }, 104 | { 105 | "kind": "youtube#searchResult", 106 | "etag": "gOBl3PnQBN3To-0EroOe8hBB0nY", 107 | "id": { 108 | "kind": "youtube#video", 109 | "videoId": "dr_w9PZh4Qo" 110 | }, 111 | "snippet": { 112 | "publishedAt": "2024-09-02T22:39:47Z", 113 | "channelId": "UCwhotZfzYgaE1L_3AOefx9Q", 114 | "title": "小米SU7冲出停车场致1死3伤", 115 | "description": "小米SU7冲出停车场致1死3伤.", 116 | "thumbnails": { 117 | "default": { 118 | "url": "https://i.ytimg.com/vi/dr_w9PZh4Qo/default.jpg", 119 | "width": 120, 120 | "height": 90 121 | }, 122 | "medium": { 123 | "url": "https://i.ytimg.com/vi/dr_w9PZh4Qo/mqdefault.jpg", 124 | "width": 320, 125 | "height": 180 126 | }, 127 | "high": { 128 | "url": "https://i.ytimg.com/vi/dr_w9PZh4Qo/hqdefault.jpg", 129 | "width": 480, 130 | "height": 360 131 | } 132 | }, 133 | "channelTitle": "白柚诉折", 134 | "liveBroadcastContent": "none", 135 | "publishTime": "2024-09-02T22:39:47Z" 136 | } 137 | }, 138 | { 139 | "kind": "youtube#searchResult", 140 | "etag": "au1EfrwMkAk4fJ7JPlLGeO2ZOug", 141 | "id": { 142 | "kind": "youtube#video", 143 | "videoId": "xa62UaZLWPQ" 144 | }, 145 | "snippet": { 146 | "publishedAt": "2024-09-02T21:25:33Z", 147 | "channelId": "UCRlpcJpQ5I52Ld6AseM1CPQ", 148 | "title": "刚把小米SU7停门口,没想到谁都想来聊两句", 149 | "description": "", 150 | "thumbnails": { 151 | "default": { 152 | "url": "https://i.ytimg.com/vi/xa62UaZLWPQ/default.jpg", 153 | "width": 120, 154 | "height": 90 155 | }, 156 | "medium": { 157 | "url": "https://i.ytimg.com/vi/xa62UaZLWPQ/mqdefault.jpg", 158 | "width": 320, 159 | "height": 180 160 | }, 161 | "high": { 162 | "url": "https://i.ytimg.com/vi/xa62UaZLWPQ/hqdefault.jpg", 163 | "width": 480, 164 | "height": 360 165 | } 166 | }, 167 | "channelTitle": "36氪", 168 | "liveBroadcastContent": "none", 169 | "publishTime": "2024-09-02T21:25:33Z" 170 | } 171 | }, 172 | { 173 | "kind": "youtube#searchResult", 174 | "etag": "iZTrcyF9lSTOKYRhFLoHsIu3nOg", 175 | "id": { 176 | "kind": "youtube#video", 177 | "videoId": "id43LHT14cQ" 178 | }, 179 | "snippet": { 180 | "publishedAt": "2024-09-02T19:35:06Z", 181 | "channelId": "UCeEM0M1kui8GiBIApfXk5aw", 182 | "title": "小米SU7抢先体验,用外观致敬保时捷?", 183 | "description": "", 184 | "thumbnails": { 185 | "default": { 186 | "url": "https://i.ytimg.com/vi/id43LHT14cQ/default.jpg", 187 | "width": 120, 188 | "height": 90 189 | }, 190 | "medium": { 191 | "url": "https://i.ytimg.com/vi/id43LHT14cQ/mqdefault.jpg", 192 | "width": 320, 193 | "height": 180 194 | }, 195 | "high": { 196 | "url": "https://i.ytimg.com/vi/id43LHT14cQ/hqdefault.jpg", 197 | "width": 480, 198 | "height": 360 199 | } 200 | }, 201 | "channelTitle": "懂车帝视线", 202 | "liveBroadcastContent": "none", 203 | "publishTime": "2024-09-02T19:35:06Z" 204 | } 205 | }, 206 | { 207 | "kind": "youtube#searchResult", 208 | "etag": "2HA3XLlvYPcx50E4EnwQgFdqnpU", 209 | "id": { 210 | "kind": "youtube#video", 211 | "videoId": "aHbXEofZSQg" 212 | }, 213 | "snippet": { 214 | "publishedAt": "2024-09-02T19:13:15Z", 215 | "channelId": "UC-q8hZ5gskTjywXNKtxSeMQ", 216 | "title": "北京小米SU7新车到了:坐上去体验感非常好,简约大屏这车真香!", 217 | "description": "", 218 | "thumbnails": { 219 | "default": { 220 | "url": "https://i.ytimg.com/vi/aHbXEofZSQg/default.jpg", 221 | "width": 120, 222 | "height": 90 223 | }, 224 | "medium": { 225 | "url": "https://i.ytimg.com/vi/aHbXEofZSQg/mqdefault.jpg", 226 | "width": 320, 227 | "height": 180 228 | }, 229 | "high": { 230 | "url": "https://i.ytimg.com/vi/aHbXEofZSQg/hqdefault.jpg", 231 | "width": 480, 232 | "height": 360 233 | } 234 | }, 235 | "channelTitle": "井空", 236 | "liveBroadcastContent": "none", 237 | "publishTime": "2024-09-02T19:13:15Z" 238 | } 239 | }, 240 | { 241 | "kind": "youtube#searchResult", 242 | "etag": "rbIE78w3v9R06tWLjyZ_TnsnlFo", 243 | "id": { 244 | "kind": "youtube#video", 245 | "videoId": "FwE24sXfTG8" 246 | }, 247 | "snippet": { 248 | "publishedAt": "2024-09-02T18:04:09Z", 249 | "channelId": "UCqmLoqDyJgV3MpapWoq7dcQ", 250 | "title": "手机支架,你在用吗? 小米SU7 雷军 余承东", 251 | "description": "手机支架,你在用吗? 小米SU7 雷军 余承东 手机支架,你在用吗? 小米SU7 雷军 余承东 科技,行业资讯,互联网资讯.", 252 | "thumbnails": { 253 | "default": { 254 | "url": "https://i.ytimg.com/vi/FwE24sXfTG8/default.jpg", 255 | "width": 120, 256 | "height": 90 257 | }, 258 | "medium": { 259 | "url": "https://i.ytimg.com/vi/FwE24sXfTG8/mqdefault.jpg", 260 | "width": 320, 261 | "height": 180 262 | }, 263 | "high": { 264 | "url": "https://i.ytimg.com/vi/FwE24sXfTG8/hqdefault.jpg", 265 | "width": 480, 266 | "height": 360 267 | } 268 | }, 269 | "channelTitle": "吴佩频道", 270 | "liveBroadcastContent": "none", 271 | "publishTime": "2024-09-02T18:04:09Z" 272 | } 273 | }, 274 | { 275 | "kind": "youtube#searchResult", 276 | "etag": "JVva2p_zqfIK01BhmeN5L-UizUI", 277 | "id": { 278 | "kind": "youtube#video", 279 | "videoId": "3bijDxUa-CQ" 280 | }, 281 | "snippet": { 282 | "publishedAt": "2024-09-02T17:10:24Z", 283 | "channelId": "UCMIHdCgV_SW6Cy_N5fRd4oQ", 284 | "title": "小米su7模拟最真实充电场景,从9%充到90%,用时33分15秒汽车人共创计划 新能源领航计划 小米汽车 小米汽车SU7", 285 | "description": "小米su7模拟最真实充电场景,从9%充到90%,用时33分15秒汽车人共创计划 新能源领航计划 小米汽车 小米汽车SU7 小米su7模拟 ...", 286 | "thumbnails": { 287 | "default": { 288 | "url": "https://i.ytimg.com/vi/3bijDxUa-CQ/default.jpg", 289 | "width": 120, 290 | "height": 90 291 | }, 292 | "medium": { 293 | "url": "https://i.ytimg.com/vi/3bijDxUa-CQ/mqdefault.jpg", 294 | "width": 320, 295 | "height": 180 296 | }, 297 | "high": { 298 | "url": "https://i.ytimg.com/vi/3bijDxUa-CQ/hqdefault.jpg", 299 | "width": 480, 300 | "height": 360 301 | } 302 | }, 303 | "channelTitle": "腾飞🚚", 304 | "liveBroadcastContent": "none", 305 | "publishTime": "2024-09-02T17:10:24Z" 306 | } 307 | }, 308 | { 309 | "kind": "youtube#searchResult", 310 | "etag": "APWqSh1aJRvp6Zfu9_Z2DY-EPZA", 311 | "id": { 312 | "kind": "youtube#video", 313 | "videoId": "JU0qJJo2M8M" 314 | }, 315 | "snippet": { 316 | "publishedAt": "2024-09-02T17:00:14Z", 317 | "channelId": "UCS9byF4CtRkVYNyDOH8ZQEw", 318 | "title": "小米SU7最强的竞争对手来了,智己L6到底有哪些黑科技?", 319 | "description": "小米SU7最强的竞争对手来了,智己L6到底有哪些黑科技?", 320 | "thumbnails": { 321 | "default": { 322 | "url": "https://i.ytimg.com/vi/JU0qJJo2M8M/default.jpg", 323 | "width": 120, 324 | "height": 90 325 | }, 326 | "medium": { 327 | "url": "https://i.ytimg.com/vi/JU0qJJo2M8M/mqdefault.jpg", 328 | "width": 320, 329 | "height": 180 330 | }, 331 | "high": { 332 | "url": "https://i.ytimg.com/vi/JU0qJJo2M8M/hqdefault.jpg", 333 | "width": 480, 334 | "height": 360 335 | } 336 | }, 337 | "channelTitle": "康熠车视界", 338 | "liveBroadcastContent": "none", 339 | "publishTime": "2024-09-02T17:00:14Z" 340 | } 341 | }, 342 | { 343 | "kind": "youtube#searchResult", 344 | "etag": "rzpLq58QTXimNVelWzoTtBZ50oQ", 345 | "id": { 346 | "kind": "youtube#video", 347 | "videoId": "5fHRyrcwIe4" 348 | }, 349 | "snippet": { 350 | "publishedAt": "2024-09-02T17:00:07Z", 351 | "channelId": "UCnBdlKJ5qQvihdPQOwHzr3w", 352 | "title": "25万左右预算|比亚迪宋L/小米SU7/极氪001,如何选?", 353 | "description": "25万左右预算|比亚迪宋L/小米SU7/极氪001,如何选?", 354 | "thumbnails": { 355 | "default": { 356 | "url": "https://i.ytimg.com/vi/5fHRyrcwIe4/default.jpg", 357 | "width": 120, 358 | "height": 90 359 | }, 360 | "medium": { 361 | "url": "https://i.ytimg.com/vi/5fHRyrcwIe4/mqdefault.jpg", 362 | "width": 320, 363 | "height": 180 364 | }, 365 | "high": { 366 | "url": "https://i.ytimg.com/vi/5fHRyrcwIe4/hqdefault.jpg", 367 | "width": 480, 368 | "height": 360 369 | } 370 | }, 371 | "channelTitle": "赣闽鹏哥", 372 | "liveBroadcastContent": "none", 373 | "publishTime": "2024-09-02T17:00:07Z" 374 | } 375 | }, 376 | { 377 | "kind": "youtube#searchResult", 378 | "etag": "gnodCgUxjfYFok3mZ5AeQMX2KpY", 379 | "id": { 380 | "kind": "youtube#video", 381 | "videoId": "AYlfXvFpu90" 382 | }, 383 | "snippet": { 384 | "publishedAt": "2024-09-02T16:00:10Z", 385 | "channelId": "UCOT1sEw4_ZZ5xnH5JPQXsXA", 386 | "title": "小米SU7实体启动键到底有没有用|用得上 第九百一十六集", 387 | "description": "", 388 | "thumbnails": { 389 | "default": { 390 | "url": "https://i.ytimg.com/vi/AYlfXvFpu90/default.jpg", 391 | "width": 120, 392 | "height": 90 393 | }, 394 | "medium": { 395 | "url": "https://i.ytimg.com/vi/AYlfXvFpu90/mqdefault.jpg", 396 | "width": 320, 397 | "height": 180 398 | }, 399 | "high": { 400 | "url": "https://i.ytimg.com/vi/AYlfXvFpu90/hqdefault.jpg", 401 | "width": 480, 402 | "height": 360 403 | } 404 | }, 405 | "channelTitle": "用得上 YDS365", 406 | "liveBroadcastContent": "none", 407 | "publishTime": "2024-09-02T16:00:10Z" 408 | } 409 | }, 410 | { 411 | "kind": "youtube#searchResult", 412 | "etag": "uqDmTgZ0MnuXtQmBaoNxiSKDMwA", 413 | "id": { 414 | "kind": "youtube#video", 415 | "videoId": "6O3gBQdziBA" 416 | }, 417 | "snippet": { 418 | "publishedAt": "2024-09-02T14:00:11Z", 419 | "channelId": "UCzNuNdBEPq6XJ_ki8-Cc8fw", 420 | "title": "极狐阿尔法S5对比小米Su7 ,谁才应该是真正的“流量王”", 421 | "description": "极狐阿尔法S5对比小米Su7 ,谁才应该是真正的“流量王”", 422 | "thumbnails": { 423 | "default": { 424 | "url": "https://i.ytimg.com/vi/6O3gBQdziBA/default.jpg", 425 | "width": 120, 426 | "height": 90 427 | }, 428 | "medium": { 429 | "url": "https://i.ytimg.com/vi/6O3gBQdziBA/mqdefault.jpg", 430 | "width": 320, 431 | "height": 180 432 | }, 433 | "high": { 434 | "url": "https://i.ytimg.com/vi/6O3gBQdziBA/hqdefault.jpg", 435 | "width": 480, 436 | "height": 360 437 | } 438 | }, 439 | "channelTitle": "AUTO CHINA", 440 | "liveBroadcastContent": "none", 441 | "publishTime": "2024-09-02T14:00:11Z" 442 | } 443 | }, 444 | { 445 | "kind": "youtube#searchResult", 446 | "etag": "T6JJvLRPvoQCUJD-i1eauUFevEQ", 447 | "id": { 448 | "kind": "youtube#video", 449 | "videoId": "m_PWLHdNnas" 450 | }, 451 | "snippet": { 452 | "publishedAt": "2024-09-02T12:00:56Z", 453 | "channelId": "UCDQnodEiA--PIts6QA_mkyQ", 454 | "title": "#小米su7销量 #小米su7 都卖哪去了?#广东 #北京", 455 | "description": "小米su7销量 #小米su7 都卖哪去了?#广东 #北京.", 456 | "thumbnails": { 457 | "default": { 458 | "url": "https://i.ytimg.com/vi/m_PWLHdNnas/default.jpg", 459 | "width": 120, 460 | "height": 90 461 | }, 462 | "medium": { 463 | "url": "https://i.ytimg.com/vi/m_PWLHdNnas/mqdefault.jpg", 464 | "width": 320, 465 | "height": 180 466 | }, 467 | "high": { 468 | "url": "https://i.ytimg.com/vi/m_PWLHdNnas/hqdefault.jpg", 469 | "width": 480, 470 | "height": 360 471 | } 472 | }, 473 | "channelTitle": "撒把兄弟-奇车说", 474 | "liveBroadcastContent": "none", 475 | "publishTime": "2024-09-02T12:00:56Z" 476 | } 477 | }, 478 | { 479 | "kind": "youtube#searchResult", 480 | "etag": "lfVuUdem_OuE0a3eNgGPjUD0Udk", 481 | "id": { 482 | "kind": "youtube#video", 483 | "videoId": "8W6U1QDEq7Q" 484 | }, 485 | "snippet": { 486 | "publishedAt": "2024-09-02T12:00:08Z", 487 | "channelId": "UC2KBpviiiNOS6bVhuhDHmag", 488 | "title": "中国新能源车企公布成绩,小米SU7连续三月破万,将提前完成全年目标", 489 | "description": "", 490 | "thumbnails": { 491 | "default": { 492 | "url": "https://i.ytimg.com/vi/8W6U1QDEq7Q/default.jpg", 493 | "width": 120, 494 | "height": 90 495 | }, 496 | "medium": { 497 | "url": "https://i.ytimg.com/vi/8W6U1QDEq7Q/mqdefault.jpg", 498 | "width": 320, 499 | "height": 180 500 | }, 501 | "high": { 502 | "url": "https://i.ytimg.com/vi/8W6U1QDEq7Q/hqdefault.jpg", 503 | "width": 480, 504 | "height": 360 505 | } 506 | }, 507 | "channelTitle": "珉骏MinJun", 508 | "liveBroadcastContent": "none", 509 | "publishTime": "2024-09-02T12:00:08Z" 510 | } 511 | }, 512 | { 513 | "kind": "youtube#searchResult", 514 | "etag": "p_BC_uNDtE41h39uQxNnvgh0VIw", 515 | "id": { 516 | "kind": "youtube#video", 517 | "videoId": "kJX2HhyYI2g" 518 | }, 519 | "snippet": { 520 | "publishedAt": "2024-09-02T10:39:13Z", 521 | "channelId": "UCADanVV6vG4wUzcBrPcAi_g", 522 | "title": "雷军称小米SU7首销权益今日截止,还在犹豫的抓紧时间了", 523 | "description": "雷军称小米SU7首销权益今日截止,还在犹豫的抓紧时间了.", 524 | "thumbnails": { 525 | "default": { 526 | "url": "https://i.ytimg.com/vi/kJX2HhyYI2g/default.jpg", 527 | "width": 120, 528 | "height": 90 529 | }, 530 | "medium": { 531 | "url": "https://i.ytimg.com/vi/kJX2HhyYI2g/mqdefault.jpg", 532 | "width": 320, 533 | "height": 180 534 | }, 535 | "high": { 536 | "url": "https://i.ytimg.com/vi/kJX2HhyYI2g/hqdefault.jpg", 537 | "width": 480, 538 | "height": 360 539 | } 540 | }, 541 | "channelTitle": "FE电竞游戏", 542 | "liveBroadcastContent": "none", 543 | "publishTime": "2024-09-02T10:39:13Z" 544 | } 545 | }, 546 | { 547 | "kind": "youtube#searchResult", 548 | "etag": "P56cf8rOzx_WzBvoT-LmNKuY0jE", 549 | "id": { 550 | "kind": "youtube#video", 551 | "videoId": "MDTfPkJgKfA" 552 | }, 553 | "snippet": { 554 | "publishedAt": "2024-09-02T10:03:09Z", 555 | "channelId": "UC-wdoO6CO1ZiciHmR5GAhig", 556 | "title": "这个地方根本待不够#小米汽车 #小米SU7 #2024成都车展 #米抠", 557 | "description": "这个地方根本待不够#小米汽车#小米SU7 #2024成都车展#米抠.", 558 | "thumbnails": { 559 | "default": { 560 | "url": "https://i.ytimg.com/vi/MDTfPkJgKfA/default.jpg", 561 | "width": 120, 562 | "height": 90 563 | }, 564 | "medium": { 565 | "url": "https://i.ytimg.com/vi/MDTfPkJgKfA/mqdefault.jpg", 566 | "width": 320, 567 | "height": 180 568 | }, 569 | "high": { 570 | "url": "https://i.ytimg.com/vi/MDTfPkJgKfA/hqdefault.jpg", 571 | "width": 480, 572 | "height": 360 573 | } 574 | }, 575 | "channelTitle": "快把闺蜜带走", 576 | "liveBroadcastContent": "none", 577 | "publishTime": "2024-09-02T10:03:09Z" 578 | } 579 | }, 580 | { 581 | "kind": "youtube#searchResult", 582 | "etag": "9AxzdPt8Um2waRi9l8DO18nNmT8", 583 | "id": { 584 | "kind": "youtube#video", 585 | "videoId": "Q13lvxodCH4" 586 | }, 587 | "snippet": { 588 | "publishedAt": "2024-09-02T08:26:00Z", 589 | "channelId": "UCpNdoINrL7oNwTYSsnd6wgg", 590 | "title": "一镜到底!带你们体验小米SU7最新版本的城市NOA真实表现!", 591 | "description": "", 592 | "thumbnails": { 593 | "default": { 594 | "url": "https://i.ytimg.com/vi/Q13lvxodCH4/default.jpg", 595 | "width": 120, 596 | "height": 90 597 | }, 598 | "medium": { 599 | "url": "https://i.ytimg.com/vi/Q13lvxodCH4/mqdefault.jpg", 600 | "width": 320, 601 | "height": 180 602 | }, 603 | "high": { 604 | "url": "https://i.ytimg.com/vi/Q13lvxodCH4/hqdefault.jpg", 605 | "width": 480, 606 | "height": 360 607 | } 608 | }, 609 | "channelTitle": "Ac迈脚", 610 | "liveBroadcastContent": "none", 611 | "publishTime": "2024-09-02T08:26:00Z" 612 | } 613 | }, 614 | { 615 | "kind": "youtube#searchResult", 616 | "etag": "90ucuVNQKvODHG5JaFG9keU9qjw", 617 | "id": { 618 | "kind": "youtube#video", 619 | "videoId": "UVJjUsJeSY0" 620 | }, 621 | "snippet": { 622 | "publishedAt": "2024-09-02T07:24:17Z", 623 | "channelId": "UCJ1MlRtJbop89y-D5U8-Fag", 624 | "title": "40度!小米SU7夏季用车体验「玩具龙」", 625 | "description": "夏天开车的小伙伴温度还遭得住吗?前不久我们刚发了智界S7的夏季用车,测了空调和车玻璃。还有不少小伙伴想看看小米SU7, ...", 626 | "thumbnails": { 627 | "default": { 628 | "url": "https://i.ytimg.com/vi/UVJjUsJeSY0/default.jpg", 629 | "width": 120, 630 | "height": 90 631 | }, 632 | "medium": { 633 | "url": "https://i.ytimg.com/vi/UVJjUsJeSY0/mqdefault.jpg", 634 | "width": 320, 635 | "height": 180 636 | }, 637 | "high": { 638 | "url": "https://i.ytimg.com/vi/UVJjUsJeSY0/hqdefault.jpg", 639 | "width": 480, 640 | "height": 360 641 | } 642 | }, 643 | "channelTitle": "玩具龙快飞", 644 | "liveBroadcastContent": "none", 645 | "publishTime": "2024-09-02T07:24:17Z" 646 | } 647 | }, 648 | { 649 | "kind": "youtube#searchResult", 650 | "etag": "iLoLnrks8XvT0f21Svfw4OtMzrU", 651 | "id": { 652 | "kind": "youtube#video", 653 | "videoId": "AKTaicGAQm8" 654 | }, 655 | "snippet": { 656 | "publishedAt": "2024-09-02T06:36:37Z", 657 | "channelId": "UCB799tHSL4ABnuNJjhIpQqA", 658 | "title": "小米自研声音大模型,上线SU7车外唤醒防御", 659 | "description": "小米SU7再更新,车外唤醒防御功能上线,抑制率达99%", 660 | "thumbnails": { 661 | "default": { 662 | "url": "https://i.ytimg.com/vi/AKTaicGAQm8/default.jpg", 663 | "width": 120, 664 | "height": 90 665 | }, 666 | "medium": { 667 | "url": "https://i.ytimg.com/vi/AKTaicGAQm8/mqdefault.jpg", 668 | "width": 320, 669 | "height": 180 670 | }, 671 | "high": { 672 | "url": "https://i.ytimg.com/vi/AKTaicGAQm8/hqdefault.jpg", 673 | "width": 480, 674 | "height": 360 675 | } 676 | }, 677 | "channelTitle": "最热科技", 678 | "liveBroadcastContent": "none", 679 | "publishTime": "2024-09-02T06:36:37Z" 680 | } 681 | }, 682 | { 683 | "kind": "youtube#searchResult", 684 | "etag": "wJ6WvkL9fDU1wi2hxpqbWhTPxCU", 685 | "id": { 686 | "kind": "youtube#video", 687 | "videoId": "EmA70Hm5pgM" 688 | }, 689 | "snippet": { 690 | "publishedAt": "2024-09-02T06:16:09Z", 691 | "channelId": "UCjO92Hrehsy7lmzaFlSafew", 692 | "title": "小米su7完全破圈,我承认我酸了,但又没办法,唯有钦佩", 693 | "description": "", 694 | "thumbnails": { 695 | "default": { 696 | "url": "https://i.ytimg.com/vi/EmA70Hm5pgM/default.jpg", 697 | "width": 120, 698 | "height": 90 699 | }, 700 | "medium": { 701 | "url": "https://i.ytimg.com/vi/EmA70Hm5pgM/mqdefault.jpg", 702 | "width": 320, 703 | "height": 180 704 | }, 705 | "high": { 706 | "url": "https://i.ytimg.com/vi/EmA70Hm5pgM/hqdefault.jpg", 707 | "width": 480, 708 | "height": 360 709 | } 710 | }, 711 | "channelTitle": "电动兄弟", 712 | "liveBroadcastContent": "none", 713 | "publishTime": "2024-09-02T06:16:09Z" 714 | } 715 | }, 716 | { 717 | "kind": "youtube#searchResult", 718 | "etag": "G1yxonCmRATLjEZr254Tie2c7MU", 719 | "id": { 720 | "kind": "youtube#video", 721 | "videoId": "Sqg7cG_0FAg" 722 | }, 723 | "snippet": { 724 | "publishedAt": "2024-09-02T05:27:06Z", 725 | "channelId": "UCzIUSVAglPXa5cb_R6LQnng", 726 | "title": "真丟人!小米SU7進小學課本!讓小學生來討論美不美!小米SU7剎不住車,真實車禍影片被舉報刪除!正經官媒排行榜推薦倒閉車企車型!真的太搞笑!因為愛國買了國產車,結果每天驚喜不斷!", 727 | "description": "真丟人!小米SU7進小學課本!讓小學生來討論美不美!小米SU7剎不住車,真實車禍影片被舉報刪除!正經官媒排行榜推薦倒閉車 ...", 728 | "thumbnails": { 729 | "default": { 730 | "url": "https://i.ytimg.com/vi/Sqg7cG_0FAg/default.jpg", 731 | "width": 120, 732 | "height": 90 733 | }, 734 | "medium": { 735 | "url": "https://i.ytimg.com/vi/Sqg7cG_0FAg/mqdefault.jpg", 736 | "width": 320, 737 | "height": 180 738 | }, 739 | "high": { 740 | "url": "https://i.ytimg.com/vi/Sqg7cG_0FAg/hqdefault.jpg", 741 | "width": 480, 742 | "height": 360 743 | } 744 | }, 745 | "channelTitle": "小人物說中國", 746 | "liveBroadcastContent": "none", 747 | "publishTime": "2024-09-02T05:27:06Z" 748 | } 749 | }, 750 | { 751 | "kind": "youtube#searchResult", 752 | "etag": "6OGGBoLjDdLg8yJ_KEo6xwW1-Wk", 753 | "id": { 754 | "kind": "youtube#video", 755 | "videoId": "GYF7CKavq_Y" 756 | }, 757 | "snippet": { 758 | "publishedAt": "2024-09-02T04:14:20Z", 759 | "channelId": "UCmNmG1KCni8TIp99mEYy_7g", 760 | "title": "离谱,开小米SU7也会车窗抛物?", 761 | "description": "离谱,开小米SU7也会车窗抛物? 这还是晚高峰哦,人车那么多,他已经不在乎了吗?你怎么看?", 762 | "thumbnails": { 763 | "default": { 764 | "url": "https://i.ytimg.com/vi/GYF7CKavq_Y/default.jpg", 765 | "width": 120, 766 | "height": 90 767 | }, 768 | "medium": { 769 | "url": "https://i.ytimg.com/vi/GYF7CKavq_Y/mqdefault.jpg", 770 | "width": 320, 771 | "height": 180 772 | }, 773 | "high": { 774 | "url": "https://i.ytimg.com/vi/GYF7CKavq_Y/hqdefault.jpg", 775 | "width": 480, 776 | "height": 360 777 | } 778 | }, 779 | "channelTitle": "onroad", 780 | "liveBroadcastContent": "none", 781 | "publishTime": "2024-09-02T04:14:20Z" 782 | } 783 | }, 784 | { 785 | "kind": "youtube#searchResult", 786 | "etag": "yl7xgLO_WRrVLoVDwgVEqVbPoas", 787 | "id": { 788 | "kind": "youtube#video", 789 | "videoId": "Ss_C0owStlY" 790 | }, 791 | "snippet": { 792 | "publishedAt": "2024-09-02T02:26:46Z", 793 | "channelId": "UCvLczCZl_4qZzo0KNibzqVQ", 794 | "title": "静态体验领克z10,小米SU7真正的对手?", 795 | "description": "", 796 | "thumbnails": { 797 | "default": { 798 | "url": "https://i.ytimg.com/vi/Ss_C0owStlY/default.jpg", 799 | "width": 120, 800 | "height": 90 801 | }, 802 | "medium": { 803 | "url": "https://i.ytimg.com/vi/Ss_C0owStlY/mqdefault.jpg", 804 | "width": 320, 805 | "height": 180 806 | }, 807 | "high": { 808 | "url": "https://i.ytimg.com/vi/Ss_C0owStlY/hqdefault.jpg", 809 | "width": 480, 810 | "height": 360 811 | } 812 | }, 813 | "channelTitle": "CarGame", 814 | "liveBroadcastContent": "none", 815 | "publishTime": "2024-09-02T02:26:46Z" 816 | } 817 | }, 818 | { 819 | "kind": "youtube#searchResult", 820 | "etag": "VWjQr8DZ1ocJ-YYSwb5CJUd9MjQ", 821 | "id": { 822 | "kind": "youtube#video", 823 | "videoId": "NY_WaZ27z2c" 824 | }, 825 | "snippet": { 826 | "publishedAt": "2024-09-01T23:43:15Z", 827 | "channelId": "UCTRR9R3YizKl_A4z_QMKwUQ", 828 | "title": "北京小米SU7新车到了坐上去体验感非常好,简约大屏这车真香!", 829 | "description": "", 830 | "thumbnails": { 831 | "default": { 832 | "url": "https://i.ytimg.com/vi/NY_WaZ27z2c/default.jpg", 833 | "width": 120, 834 | "height": 90 835 | }, 836 | "medium": { 837 | "url": "https://i.ytimg.com/vi/NY_WaZ27z2c/mqdefault.jpg", 838 | "width": 320, 839 | "height": 180 840 | }, 841 | "high": { 842 | "url": "https://i.ytimg.com/vi/NY_WaZ27z2c/hqdefault.jpg", 843 | "width": 480, 844 | "height": 360 845 | } 846 | }, 847 | "channelTitle": "井空", 848 | "liveBroadcastContent": "none", 849 | "publishTime": "2024-09-01T23:43:15Z" 850 | } 851 | } 852 | ] -------------------------------------------------------------------------------- /youtube_video_download/youtube_video_get.py: -------------------------------------------------------------------------------- 1 | # import yt_dlp 2 | 3 | # # 输入要下载的YouTube视频地址 4 | # url='https://www.youtube.com/watch?v=SAL-mNE10TA' 5 | # ydl_opts={ 6 | # 'outtmpl': '指定的路径/123.mp4' 7 | # } 8 | 9 | # with yt_dlp.YoutubeDL(ydl_opts) as ydl: 10 | # ydl.download([url]) 11 | 12 | # print("Video downloaded successfully!") 13 | 14 | 15 | # # https://www.youtube.com/watch?v=SAL-mNE10TA 16 | 17 | 18 | ##https://developers.google.com/youtube/v3/docs?hl=zh-cn 19 | 20 | 21 | import yt_dlp 22 | import requests 23 | import json 24 | import os 25 | from fake_useragent import UserAgent 26 | import pandas as pd 27 | from datetime import datetime 28 | 29 | class yt_video: 30 | #配置参数 31 | def __init__(self,page,word,API_key): 32 | #关键词 33 | self.word = word 34 | # 请求地址 35 | self.url = 'https://youtube.googleapis.com/youtube/v3/search' 36 | #视频地址前缀 37 | self.video_url = 'https://www.youtube.com/watch?v=' 38 | # 生成随机的用户代理 39 | ua = UserAgent() 40 | user_agent = ua.random 41 | # 请求头 42 | self.headers = { 43 | "Accept": "*/*", 44 | "User-Agent": user_agent 45 | } 46 | # 请求参数,其他参数看官网文档修改或增加即可 47 | self.params = { 48 | 'part': 'snippet', 49 | 'maxResults': '25', 50 | 'q': self.word, 51 | 'key': API_key, 52 | 'order': 'date', 53 | "pageToken":'', 54 | 'type':'video' 55 | } 56 | #存response_json的列表容器 57 | self.res_lst = [] 58 | #页数 59 | self.page = int(page) 60 | #获取当前脚本所在的路径 61 | self.current_dir = os.path.dirname(os.path.abspath(__file__)) 62 | #存字典的容器 63 | self.dict_lst = [] 64 | # 获取当前时间 65 | # 格式化时间为'2024_01_02_03_04_05'形式,年_月_日_时_分_秒形式 66 | current_time = datetime.now() 67 | self.formatted_time = current_time.strftime('%Y_%m_%d_%H_%M_%S') 68 | #创建存视频的文件夹路径 69 | self.folder_path = self.current_dir + '/' + self.formatted_time 70 | os.makedirs(self.folder_path, exist_ok=True) 71 | 72 | 73 | #启动请求函数 74 | def start_requests(self): 75 | 76 | for _ in range(self.page): #取数据的页数,默认一页25条 77 | res = requests.get(url=self.url, headers=self.headers, params=self.params) 78 | response = json.loads(res.text) 79 | self.res_lst.extend(response['items']) 80 | 81 | if 'nextPageToken' in response: 82 | self.params['pageToken'] = response['nextPageToken'] 83 | else: 84 | break 85 | 86 | for video in self.res_lst: 87 | # 创建一个空字典 88 | author_dict = {} 89 | author_dict['作者'] = video['snippet']['channelTitle'] 90 | author_dict['标题'] = video['snippet']['title'] 91 | author_dict['描述/类型'] = video['snippet']['description'] 92 | author_dict['发布时间'] = video['snippet']['publishTime'] 93 | author_dict['封面图片地址'] = video['snippet']['thumbnails']['high']['url'] 94 | author_dict['视频id'] = video['id']['videoId'] 95 | author_dict['视频地址'] = self.video_url + video['id']['videoId'] 96 | self.dict_lst.append(author_dict) 97 | df = pd.DataFrame(self.dict_lst) 98 | 99 | # 要生成的文件名 100 | json_file_path = os.path.join(self.current_dir, 'result.json') 101 | csv_file_path = os.path.join(self.current_dir, self.formatted_time+self.word+'.csv') 102 | #把json存文件 103 | with open(json_file_path, 'w', encoding='utf-8') as f: 104 | json.dump(self.res_lst, f, ensure_ascii=False, indent=4) 105 | 106 | #把df存csv文件 107 | df.to_csv(csv_file_path, encoding='utf-8-sig', index=False) 108 | 109 | print(df) 110 | 111 | #循环下载每一个视频 112 | for index, row in df.iterrows(): 113 | try: 114 | self.download(row['视频地址'],row['标题']) 115 | print("##################################################################") 116 | except Exception as e: 117 | print(row['标题']) 118 | print("Video downloaded error!:---" + str(e)) 119 | print("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!") 120 | 121 | 122 | return df 123 | 124 | 125 | def download(self,download_url,title): 126 | #保存路径,标题作为视频名字 127 | title = title.replace('/','|') 128 | ydl_opts={ 129 | 'outtmpl': self.folder_path + '/'+ title + '.mp4', 130 | 'cookiefile': 'cookies.txt' 131 | } 132 | 133 | with yt_dlp.YoutubeDL(ydl_opts) as ydl: 134 | ydl.download([download_url]) 135 | 136 | return "Video downloaded successfully!" 137 | 138 | 139 | if __name__ == '__main__': 140 | #页数 141 | page = '1' 142 | #关键词 143 | word = '小米su7' 144 | #你的apikey 145 | api_key = '' 146 | #按顺序传参:页数,关键词,你的apikey 147 | result = yt_video(page,word,api_key) 148 | 149 | a = result.start_requests() 150 | 151 | print(a['标题']) 152 | 153 | -------------------------------------------------------------------------------- /京东--关键词搜索商品信息采集/JD_spider.py: -------------------------------------------------------------------------------- 1 | import requests, json 2 | from bs4 import BeautifulSoup 3 | import os 4 | import pandas as pd 5 | import time 6 | 7 | # 父类 8 | class OBJECT_JD: 9 | def __init__(self, cookie, use_cookie=True): 10 | if use_cookie: 11 | self.headers = { 12 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) ' 13 | 'Chrome/80.0.3987.149 Safari/537.36', 14 | 'cookie': cookie} 15 | else: 16 | self.headers = { 17 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) ' 18 | 'Chrome/80.0.3987.149 Safari/537.36' 19 | } 20 | self.sess = requests.session() 21 | self.sess.headers.update(self.headers) 22 | self.file_name = 'jd_product.csv' 23 | # Check if file already exists, if not create it and write the header 24 | if not os.path.exists(self.file_name): 25 | df = pd.DataFrame(columns=[ 26 | 'sku', '图片', '价格', '商品标题', '评论数', 27 | '评论链接', '店铺名', '店铺链接','地区' 28 | ]) 29 | df.to_csv(self.file_name, index=False, encoding='utf-8-sig') 30 | 31 | 32 | # spider类 33 | class Spider(OBJECT_JD): 34 | def __init__(self, cookie, keyword, end_page): 35 | super(Spider, self).__init__(cookie) 36 | self.keyword = keyword 37 | self.end_page = end_page 38 | self.start_url = 'https://search.jd.com/Search?keyword=' + keyword + '&enc=utf-8&pvid=d6748e8118e14fd8afae40867d7d52f9' 39 | 40 | 41 | def get_item_info(self,url): 42 | 43 | res = self.sess.get(url).text 44 | 45 | with open('jd.html', 'w', encoding='utf-8') as a: 46 | a.write(res) 47 | 48 | soup = BeautifulSoup(res, 'html.parser') 49 | 50 | li_lst = soup.find_all('li',attrs={'class':'gl-item'}) 51 | 52 | item_lst = [] 53 | 54 | #解析网页元素,bs4 55 | for i in li_lst: 56 | #sku# 57 | sku = i['data-sku'] 58 | ######### 59 | 60 | #img 61 | img = i.find('div',attrs={'class':'p-img'}) 62 | if img: 63 | img = img.find('img') 64 | if img: 65 | img = img.get('data-lazy-img') 66 | ########## 67 | 68 | #price 69 | price = i.find('div',attrs = {'class':'p-price'}) 70 | if price: 71 | price = price.find('i') 72 | if price: 73 | price = price.get_text() 74 | ######### 75 | 76 | #text_ 77 | text_ = i.find('div',attrs = {'class':'p-name p-name-type-2'}) 78 | if text_: 79 | text_ = text_.find('em') 80 | if text_: 81 | text_ = text_.get_text() 82 | ########## 83 | 84 | #comment p-commit 85 | comment = i.find('div',attrs = {'class':'p-commit'}) 86 | if comment: 87 | comment = comment.find('a') 88 | if comment: 89 | comment = comment.get_text() 90 | ######### 91 | 92 | #coment_herf 93 | coment_herf = i.find('div',attrs = {'class':'p-commit'}) 94 | if coment_herf: 95 | coment_herf = coment_herf.find('a') 96 | if coment_herf: 97 | coment_herf = coment_herf['href'] 98 | ######### 99 | 100 | #shop_name 101 | shop_name = i.find('div',attrs={'class':'p-shop'}) 102 | if shop_name: 103 | shop_name = shop_name.find('a') 104 | if shop_name: 105 | shop_name = shop_name.get_text() 106 | ######### 107 | 108 | #shop_href 109 | shop_href = i.find('div',attrs={'class':'p-shop'}) 110 | if shop_href: 111 | shop_href = shop_href.find('a') 112 | if shop_href: 113 | shop_href = shop_href['href'] 114 | ######### 115 | 116 | #area 117 | area = i.find('div',attrs = {'class':'p-stock hide'}) 118 | if area: 119 | area = area.get('data-province') 120 | ########## 121 | 122 | 123 | item_lst.append([sku, img,price,text_,comment,coment_herf,shop_name,shop_href,area]) 124 | print(item_lst) 125 | 126 | #收集的二位列表转pandas,df结构 127 | df = pd.DataFrame(item_lst) 128 | 129 | # 写入csv文件 130 | df.to_csv(self.file_name, mode='a', index=False, header=False, encoding='utf-8-sig') 131 | 132 | 133 | 134 | return item_lst 135 | 136 | 137 | def start_spider(self): 138 | 139 | for page in range(1,self.end_page+1): 140 | 141 | url = self.start_url+'&page='+str(page) 142 | 143 | print(url) 144 | 145 | print('关键词:'+self.keyword+'--第'+str(page)+'页') 146 | 147 | #请求间隔 148 | time.sleep(2) 149 | 150 | #带着url启动请求函数 151 | result = self.get_item_info(url) 152 | 153 | print(result) 154 | 155 | return '执行完毕' 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | if __name__ == "__main__": 165 | #复制cookie 地区更换#area #iploc 166 | cookie_str = '' 167 | 168 | # 输入cookie,关键词,抓取页数 169 | #启动spider类 170 | content_page = Spider(cookie_str, 'iphone15', 2) 171 | #启动爬虫,根据页数循环请求 172 | response = content_page.start_spider() 173 | 174 | print(response) -------------------------------------------------------------------------------- /京东--关键词搜索商品信息采集/area_info.config: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Prycekim/python_spider_idea_learn_share/4e34386524b8703752a0c51f4888e4e1ef04194f/京东--关键词搜索商品信息采集/area_info.config -------------------------------------------------------------------------------- /京东--关键词搜索商品信息采集/jd.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Prycekim/python_spider_idea_learn_share/4e34386524b8703752a0c51f4888e4e1ef04194f/京东--关键词搜索商品信息采集/jd.html -------------------------------------------------------------------------------- /京东--关键词搜索商品信息采集/jd_product.csv: -------------------------------------------------------------------------------- 1 | sku,图片,价格,商品标题,评论数,评论链接,店铺名,店铺链接,地区 2 | -------------------------------------------------------------------------------- /京东--关键词搜索商品信息采集/readme.txt: -------------------------------------------------------------------------------- 1 | ## 使用说明 2 | 3 | 本程序是针对京东关键词搜索出来的商品信息进行采集 4 | 自己复制cookie到程序中 5 | 会发现地区信息包含在cookie里的 ipLoc-djd 和 area 字段中 6 | 如有更换地区的商品信息需求 7 | 可以到area_info.txt文件中去做对照并到你的cookie中修改 8 | 例如北京东城区:area=1 ; ipLoc-djd=1-72 9 | 10 | 代码仅供参考,本项目仅供学习和研究使用,仅限于学习交流,切勿用于商业用途,如有侵权,请及时联系作者删除 11 | 12 | 13 | 如有小伙伴,有更好的建议或不明白的部分,欢迎随时联系我进行讨论 14 | -------------------------------------------------------------------------------- /百度翻译spider/1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Prycekim/python_spider_idea_learn_share/4e34386524b8703752a0c51f4888e4e1ef04194f/百度翻译spider/1.txt -------------------------------------------------------------------------------- /百度翻译spider/readme.txt: -------------------------------------------------------------------------------- 1 | ## 使用说明 2 | 3 | 本程序是对在线版百度翻译接口进行js逆向工程的学习, 4 | 主要是针对于sign参数进行解密, 5 | 6 | 代码仅供参考,本项目仅供学习和研究使用,仅限于学习交流,切勿用于商业用途,如有侵权,请及时联系作者删除 7 | 8 | 9 | 如有小伙伴,有更好的建议或不明白的部分,欢迎随时联系我进行讨论 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /百度翻译spider/ua_info.py: -------------------------------------------------------------------------------- 1 | ua_list = [ 2 | 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Maxthon 2.0', 3 | 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_0) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11', 4 | 'User-Agent:Opera/9.80 (Windows NT 6.1; U; en) Presto/2.8.131 Version/11.11', 5 | 'Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1', 6 | 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)', 7 | 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50', 8 | 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0', 9 | 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1', 10 | 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1', 11 | 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0.1) Gecko/20100101 Firefox/4.0.1', 12 | ] -------------------------------------------------------------------------------- /百度翻译spider/百度translate.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import json 3 | import time 4 | import subprocess 5 | from ua_info import ua_list 6 | import random 7 | 8 | #时间戳获取 9 | timestamp = int(time.time() * 1000) # 将秒转换为毫秒 10 | print(timestamp) 11 | 12 | #进入并执行js文件,查询的单词进行传参,再返回结果(主要是sign的破解算法) 13 | def call_js_function(word): 14 | result = subprocess.run( 15 | ['node', '百度翻译参数破译.js',word], 16 | capture_output=True, 17 | text=True 18 | ) 19 | return result.stdout.strip() 20 | 21 | #发送请求方法 22 | def tran(word,js_res,timestamp): 23 | cookies = { 24 | 'BIDUPSID': '4FD4308EC7FE26351606B171AF6BB234', 25 | 'PSTM': '1717406317', 26 | 'BAIDUID': '4FD4308EC7FE26359BFAA02C8DE44430:FG=1', 27 | 'MCITY': '-60880%3A194%3A', 28 | 'delPer': '0', 29 | 'BAIDUID_BFESS': '4FD4308EC7FE26359BFAA02C8DE44430:FG=1', 30 | 'ZFY': 'JM5WMQp8SQNgbcuXwGsVGyEt1l36gtNkkX0ErJAWMaw:C', 31 | 'H_WISE_SIDS': '60448_60360_60452_60466_60441', 32 | 'H_PS_PSSID': '60448_60360_60452_60466_60441_60492_60498', 33 | 'PSINO': '7', 34 | 'BDORZ': 'B490B5EBF6F3CD402E515D22BCDA1598', 35 | 'BA_HECTOR': '8h002480a48ga08k20a521a40hl2lf1j9rcc01u', 36 | 'BCLID': '11133934466993760698', 37 | 'BCLID_BFESS': '11133934466993760698', 38 | 'BDSFRCVID': '1RPOJexroG3aT7rtwEihM2xkjzky-p7TDYLEOwXPsp3LGJLVYm5TEG0Ptq58Eh4b6j3eogKK3mOTHR8F_2uxOjjg8UtVJeC6EG0Ptf8g0M5', 39 | 'BDSFRCVID_BFESS': '1RPOJexroG3aT7rtwEihM2xkjzky-p7TDYLEOwXPsp3LGJLVYm5TEG0Ptq58Eh4b6j3eogKK3mOTHR8F_2uxOjjg8UtVJeC6EG0Ptf8g0M5', 40 | 'H_BDCLCKID_SF': 'tbC8VCDKJDD3H48k-4QEbbQH-UnLq-FtBgOZ04n-ah05Hf-6KR8Bj6_yXH5Oa-TE25KLQI3m3UTdsq76Wh35K5tTQP6rLqcLJGn4KKJxbPDhbh5dj-K-M6t8hUJiB5JLBan7bDnIXKohJh7FM4tW3J0ZyxomtfQxtNRJ0DnjtpChbC8lejuaj65LeU5eetjK2CntsJOOaCvi8DnOy4oWK441DUQntbjJfRcEohC-Mnv8JRvwqJ0b3M04X-o9-hvT-54e2p3FBUQZDD52Qft20b0LjH74aT3aJDLe0R7jWhk5Dq72yhKWQlRX5q79atTMfNTJ-qcH0KQpsIJM5-DWbT8IjHCeJ6F8tRFqoCvt-5rDHJTg5DTjhPrMKfrrWMT-MTryKKOqQI3KfKIC26OYDRkfMl6WhCrjJanRhlRNB-3iV-OxDUvnyxAZWfFtLUQxtNRJQCKy3RPMHCQFDPoobUPUDUc9LUvNfgcdot5yBbc8eIna5hjkbfJBQttjQn3hfIkj2CKLtKDBbDDCj6L3-RJH-xQ0KnLXKKOLVM3bfp7ketn4hUt5-q3WKl88tqOEBRrOBbcL2-IVqK32QhrdQf4WWb3ebTJr32Qr-fTEJxbpsIJM5bLheMLJjMKqajJ-aKviaKOEBMb1VCnDBT5h2M4qMxtOLR3pWDTm_q5TtUJMeCnTDMFhe6JLeHuDtjKDfKresJoq2RbhKROvhj4a0l8gyxoObtRxtK6n_-o2bh5EjhC42-R824P-qq0fLU3kBgT9LMnx--t58h3_XhjZhjL7QttjQn3DJRb4BIbtJJF5eJ7TyU45hf47ybKO0q4Hb6b9BJcjfU5MSlcNLTjpQT8r5MDOK5OuJRQ2QJ8BtD-KbfK', 41 | 'H_BDCLCKID_SF_BFESS': 'tbC8VCDKJDD3H48k-4QEbbQH-UnLq-FtBgOZ04n-ah05Hf-6KR8Bj6_yXH5Oa-TE25KLQI3m3UTdsq76Wh35K5tTQP6rLqcLJGn4KKJxbPDhbh5dj-K-M6t8hUJiB5JLBan7bDnIXKohJh7FM4tW3J0ZyxomtfQxtNRJ0DnjtpChbC8lejuaj65LeU5eetjK2CntsJOOaCvi8DnOy4oWK441DUQntbjJfRcEohC-Mnv8JRvwqJ0b3M04X-o9-hvT-54e2p3FBUQZDD52Qft20b0LjH74aT3aJDLe0R7jWhk5Dq72yhKWQlRX5q79atTMfNTJ-qcH0KQpsIJM5-DWbT8IjHCeJ6F8tRFqoCvt-5rDHJTg5DTjhPrMKfrrWMT-MTryKKOqQI3KfKIC26OYDRkfMl6WhCrjJanRhlRNB-3iV-OxDUvnyxAZWfFtLUQxtNRJQCKy3RPMHCQFDPoobUPUDUc9LUvNfgcdot5yBbc8eIna5hjkbfJBQttjQn3hfIkj2CKLtKDBbDDCj6L3-RJH-xQ0KnLXKKOLVM3bfp7ketn4hUt5-q3WKl88tqOEBRrOBbcL2-IVqK32QhrdQf4WWb3ebTJr32Qr-fTEJxbpsIJM5bLheMLJjMKqajJ-aKviaKOEBMb1VCnDBT5h2M4qMxtOLR3pWDTm_q5TtUJMeCnTDMFhe6JLeHuDtjKDfKresJoq2RbhKROvhj4a0l8gyxoObtRxtK6n_-o2bh5EjhC42-R824P-qq0fLU3kBgT9LMnx--t58h3_XhjZhjL7QttjQn3DJRb4BIbtJJF5eJ7TyU45hf47ybKO0q4Hb6b9BJcjfU5MSlcNLTjpQT8r5MDOK5OuJRQ2QJ8BtD-KbfK', 42 | 'smallFlowVersion': 'old', 43 | 'RT': f'"z=1&dm=baidu.com&si=f8401b89-efbd-4724-9dc1-770fce5c6382&ss=lywaillv&sl=0&tt=0&bcn=https%3A%2F%2Ffclog.baidu.com%2Flog%2Fweirwood%3Ftype%3Dperf&ld=3v7uwj&ul=2qp&hd=2u6"', 44 | 'Hm_lvt_64ecd82404c51e03dc91cb9e8c025574': '1721610631', 45 | 'Hm_lpvt_64ecd82404c51e03dc91cb9e8c025574': '1721610631', 46 | 'REALTIME_TRANS_SWITCH': '1', 47 | 'FANYI_WORD_SWITCH': '1', 48 | 'HISTORY_SWITCH': '1', 49 | 'SOUND_SPD_SWITCH': '1', 50 | 'SOUND_PREFER_SWITCH': '1', 51 | 'ab_sr': '1.0.1_MDFjZWI3Mzk1OTU3ZjhiN2M2ZTA2YmE4MDM5M2Q1ZjkyNmY4Zjk1YzVmZTI0Yjk1M2JkMWRjNTUzMDRjNjRlZDIzYjdmZDMyZGY5YTMwOTE3OGYwMjI1YWQwMWM3YTNiYTE4ZDc4YjE1OWE3MWNhM2UyZmE1MDVkNWVkY2FhOGY2OTJkY2QwOTA0MzlkOTdmODIwZDg5YTQ0NjY0ZTY3YQ==', 52 | } 53 | 54 | headers = { 55 | 'Accept': '*/*', 56 | 'Accept-Language': 'zh-CN,zh;q=0.9', 57 | 'Connection': 'keep-alive', 58 | 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', 59 | 'Origin': 'https://fanyi.baidu.com', 60 | 'Referer': "https://fanyi.baidu.com/?aldtype=16047", 61 | 'Sec-Fetch-Dest': 'empty', 62 | 'Sec-Fetch-Mode': 'cors', 63 | 'Sec-Fetch-Site': 'same-origin', 64 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36', 65 | 66 | } 67 | 68 | params = { 69 | 'from': 'zh', 70 | 'to': 'en', 71 | } 72 | 73 | data = { 74 | 'from': 'zh', 75 | 'to': 'en', 76 | 'query': word, 77 | 'transtype': 'realtime', 78 | 'simple_means_flag': '3', 79 | 'sign': js_res, 80 | 'token': 'd00baeca2247e76549934b1a565212e5', 81 | 'domain': 'common', 82 | 'ts': timestamp, 83 | } 84 | 85 | response = requests.post('https://fanyi.baidu.com/v2transapi', params=params, cookies=cookies, headers=headers, data=data) 86 | 87 | res = response.text 88 | 89 | res = json.loads(res) 90 | res = res['trans_result']['data'][0]['dst'] 91 | 92 | return res 93 | 94 | 95 | #cookie可以通过请求百度首页拿到,注意user-agent 96 | def get_(): 97 | headers = {'User-Agent':random.choice(ua_list)} 98 | 99 | url = 'https://www.baidu.com' 100 | 101 | res = requests.get(url=url,headers=headers) 102 | 103 | cookies = res.cookies 104 | 105 | return cookies 106 | 107 | 108 | #程序执行的主函数,传参要翻译的word 109 | def baidu_tran(word): 110 | print("查询:--"+word+"--") 111 | js_res = call_js_function(word) 112 | 113 | print(js_res) 114 | 115 | response= tran(word,js_res,timestamp) 116 | 117 | print(response) 118 | 119 | return response 120 | 121 | 122 | #inlet 123 | ################################## 124 | if __name__ == '__main__': 125 | baidu_tran(word = '同声传译') 126 | ################################## 127 | -------------------------------------------------------------------------------- /百度翻译spider/百度翻译参数破译.js: -------------------------------------------------------------------------------- 1 | const args = process.argv.slice(2); 2 | const e = args[0]; 3 | 4 | function main(t) { 5 | var o, i = t.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g); 6 | if (null === i) { 7 | var a = t.length; 8 | a > 30 && (t = "".concat(t.substr(0, 10)).concat(t.substr(Math.floor(a / 2) - 5, 10)).concat(t.substr(-10, 10))) 9 | } else { 10 | for (var s = t.split(/[\uD800-\uDBFF][\uDC00-\uDFFF]/), c = 0, u = s.length, l = []; c < u; c++) 11 | "" !== s[c] && l.push.apply(l, function(t) { 12 | if (Array.isArray(t)) 13 | return e(t) 14 | }(o = s[c].split("")) || function(t) { 15 | if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) 16 | return Array.from(t) 17 | }(o) || function(t, n) { 18 | if (t) { 19 | if ("string" == typeof t) 20 | return e(t, n); 21 | var r = Object.prototype.toString.call(t).slice(8, -1); 22 | return "Object" === r && t.constructor && (r = t.constructor.name), 23 | "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? e(t, n) : void 0 24 | } 25 | }(o) || function() { 26 | throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") 27 | }()), 28 | c !== u - 1 && l.push(i[c]); 29 | var p = l.length; 30 | p > 30 && (t = l.slice(0, 10).join("") + l.slice(Math.floor(p / 2) - 5, Math.floor(p / 2) + 5).join("") + l.slice(-10).join("")) 31 | } 32 | for (var d = "".concat(String.fromCharCode(103)).concat(String.fromCharCode(116)).concat(String.fromCharCode(107)), h = (null !== r ? r : (r = window[d] || "") || "").split("."), f = Number(h[0]) || 0, m = Number(h[1]) || 0, g = [], y = 0, v = 0; v < t.length; v++) { 33 | var _ = t.charCodeAt(v); 34 | _ < 128 ? g[y++] = _ : (_ < 2048 ? g[y++] = _ >> 6 | 192 : (55296 == (64512 & _) && v + 1 < t.length && 56320 == (64512 & t.charCodeAt(v + 1)) ? (_ = 65536 + ((1023 & _) << 10) + (1023 & t.charCodeAt(++v)), 35 | g[y++] = _ >> 18 | 240, 36 | g[y++] = _ >> 12 & 63 | 128) : g[y++] = _ >> 12 | 224, 37 | g[y++] = _ >> 6 & 63 | 128), 38 | g[y++] = 63 & _ | 128) 39 | } 40 | for (var b = f, w = "".concat(String.fromCharCode(43)).concat(String.fromCharCode(45)).concat(String.fromCharCode(97)) + "".concat(String.fromCharCode(94)).concat(String.fromCharCode(43)).concat(String.fromCharCode(54)), k = "".concat(String.fromCharCode(43)).concat(String.fromCharCode(45)).concat(String.fromCharCode(51)) + "".concat(String.fromCharCode(94)).concat(String.fromCharCode(43)).concat(String.fromCharCode(98)) + "".concat(String.fromCharCode(43)).concat(String.fromCharCode(45)).concat(String.fromCharCode(102)), x = 0; x < g.length; x++) 41 | b = n(b += g[x], w); 42 | return b = n(b, k), 43 | (b ^= m) < 0 && (b = 2147483648 + (2147483647 & b)), 44 | "".concat((b %= 1e6).toString(), ".").concat(b ^ f) 45 | } 46 | function n(t, e) { 47 | for (var n = 0; n < e.length - 2; n += 3) { 48 | var r = e.charAt(n + 2); 49 | r = "a" <= r ? r.charCodeAt(0) - 87 : Number(r), 50 | r = "+" === e.charAt(n + 1) ? t >>> r : t << r, 51 | t = "+" === e.charAt(n) ? t + r & 4294967295 : t ^ r 52 | } 53 | return t 54 | } 55 | var r = null 56 | 57 | var window = { 58 | 'gtk':"320305.131321201" 59 | } 60 | 61 | console.log(main(e)) -------------------------------------------------------------------------------- /网易有道翻译spider/readme.txt: -------------------------------------------------------------------------------- 1 | ## 使用说明 2 | 3 | 本程序是对在线版网易有道翻译接口进行js逆向工程的学习, 4 | 主要是针对于sign参数以及返回的response结果进行解密, 5 | 6 | 代码仅供参考,本项目仅供学习和研究使用,仅限于学习交流,切勿用于商业用途,如有侵权,请及时联系作者删除 7 | 8 | 9 | 如有小伙伴,有更好的建议或不明白的部分,欢迎随时联系我进行讨论 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /网易有道翻译spider/run.py: -------------------------------------------------------------------------------- 1 | import 网易翻译接口subprocess版 2 | 3 | 4 | a = 网易翻译接口subprocess版.wangyi_tran('同声传译') 5 | 6 | print(a) -------------------------------------------------------------------------------- /网易有道翻译spider/网易翻译response破译.js: -------------------------------------------------------------------------------- 1 | const aescrypto = require('crypto'); 2 | const crypto = require('crypto'); 3 | const args = process.argv.slice(2); 4 | const e = args[0]; 5 | 6 | 7 | 8 | function T(e) { 9 | return crypto.createHash("md5").update(e).digest() 10 | } 11 | 12 | function aes(e){ 13 | const a = Buffer.alloc(16, T(t)) 14 | , n = Buffer.alloc(16, T(o)) 15 | , r = aescrypto.createDecipheriv("aes-128-cbc", a, n); 16 | let l = r.update(e, "base64", "utf-8"); 17 | return l += r.final("utf-8"), 18 | l 19 | } 20 | // new Uint8Array([8, 20, 157, 167, 60, 89, 206, 98, 85, 91, 1, 233, 47, 52, 232, 56]) 21 | // new Uint8Array([210, 187, 27, 253, 232, 59, 56, 195, 68, 54, 99, 87, 183, 156, 174, 28]) 22 | 23 | const t = "ydsecret://query/key/B*RGygVywfNBwpmBaZg*WT7SIOUP2T0C9WHMZN39j^DAdaZhAnxvGcCY6VYFwnHl" 24 | 25 | const o = "ydsecret://query/iv/C@lZe2YzHtZ2CYgaXKSVfsb7Y4QWHjITPPZ0nQp87fBeJ!Iv6v^6fvi2WN@bYpJ4" 26 | 27 | 28 | 29 | 30 | 31 | console.log(ss = aes(e)) -------------------------------------------------------------------------------- /网易有道翻译spider/网易翻译sign参数.js: -------------------------------------------------------------------------------- 1 | const crypto = require('crypto'); 2 | 3 | const time = (new Date).getTime(); 4 | 5 | 6 | 7 | 8 | function _(e) { 9 | return crypto.createHash("md5").update(e.toString()).digest("hex") 10 | } 11 | 12 | function S(time, t) { 13 | const u = "fanyideskweb" 14 | const d = "webfanyi" 15 | return _(`client=${u}&mysticTime=${time}&product=${d}&key=${t}`) 16 | } 17 | 18 | 19 | function k(time) { 20 | const t = "fsdsogkndfokasodnaso" 21 | return [S(time,t),time] 22 | 23 | } 24 | 25 | 26 | console.log(k(time)) 27 | // console.log('sign是:') 28 | // console.log(res['sign']) 29 | // console.log('mysticTime是:') 30 | // console.log(res['mysticTime']) 31 | -------------------------------------------------------------------------------- /网易有道翻译spider/网易翻译接口subprocess版.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import requests 3 | import json 4 | 5 | #执行sign破解js文件获取执行结果,sign以及timestamp(毫秒) 6 | def call_js_function(): 7 | result = subprocess.run( 8 | ['node', '网易翻译sign参数.js'], 9 | capture_output=True, 10 | text=True 11 | ) 12 | return result.stdout.strip() 13 | 14 | #得到请求返回的密文,拿到response破解js,解密 15 | def res_js_function(a): 16 | result = subprocess.run( 17 | ['node', '网易翻译response破译.js',a], 18 | capture_output=True, 19 | text=True, 20 | encoding='utf-8' 21 | ) 22 | return result.stdout.strip() 23 | 24 | 25 | #发送请求的函数 26 | def tran(sign,word): 27 | url = 'https://dict.youdao.com/webtranslate' 28 | 29 | headers = { 30 | 'Accept': 'application/json, text/plain, */*', 31 | 'Accept-Encoding': 'gzip, deflate, br, zstd', 32 | 'Accept-Language': 'zh-CN,zh;q=0.9', 33 | 'Connection': 'keep-alive', 34 | 'Content-Type': 'application/x-www-form-urlencoded', 35 | 'Host': 'dict.youdao.com', 36 | 'Origin': 'https://fanyi.youdao.com', 37 | 'Referer': 'https://fanyi.youdao.com/', 38 | 'Sec-Ch-Ua': 'Not/A)Brand";v="8", "Chromium";v="126", "Google Chrome";v="126', 39 | 'Sec-Ch-Ua-Mobile': '?0', 40 | 'Sec-Ch-Ua-Platform': 'Windows', 41 | 'Sec-Fetch-Dest': 'empty', 42 | 'Sec-Fetch-Mode': 'cors', 43 | 'Sec-Fetch-Site': 'same-site', 44 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36', 45 | } 46 | 47 | cookie = { 48 | 'DICT_DOCTRANS_SESSION_ID':'YTc0ZDU2MGEtMzVhNS00Y2RhLThmZjMtYTQwNWMzYTBiZTk3', 49 | 'OUTFOX_SEARCH_USER_ID':'739970345@117.28.134.115', 50 | 'OUTFOX_SEARCH_USER_ID_NCOO':'1599551923.1161582', 51 | } 52 | 53 | data = { 54 | "i": word, 55 | "from": "auto", 56 | "to": "", 57 | "useTerm": "false", 58 | "dictResult": 'true', 59 | "keyid": 'webfanyi', 60 | "sign": sign[0], 61 | 'client': 'fanyideskweb', 62 | 'product': 'webfanyi', 63 | 'appVersion': '1.0.0', 64 | 'vendor': 'web', 65 | 'pointParam': 'client,mysticTime,product', 66 | 'mysticTime': sign[1], 67 | 'keyfrom': 'fanyi.web', 68 | 'mid': '1', 69 | 'screen': '1', 70 | 'model': '1', 71 | 'network': 'wifi', 72 | 'abtest': '0', 73 | 'yduuid': 'abcdefg', 74 | } 75 | 76 | res = requests.post(url=url,headers=headers,cookies=cookie,data=data) 77 | 78 | return res.text 79 | 80 | 81 | #程序执行主函数,传参要翻译的word 82 | def wangyi_tran(word): 83 | print(word) 84 | sign_result = call_js_function() 85 | sign_result = eval(sign_result) 86 | print(sign_result) 87 | 88 | 89 | 90 | sign = sign_result 91 | a = tran(sign,word) 92 | print(a) 93 | 94 | resp = res_js_function(a) 95 | resp = json.loads(resp) 96 | 97 | eng = resp['translateResult'][0][0]['tgt'] 98 | print(resp) 99 | print('翻译结果是:--'+eng) 100 | 101 | return eng 102 | 103 | 104 | 105 | #inlet 106 | ########################### 107 | 108 | if __name__ == '__main__': 109 | a = wangyi_tran('同声传译') 110 | print(a) 111 | 112 | ########################### -------------------------------------------------------------------------------- /虾皮shopee指定商品评论收集scrapy版(新加坡)/shopee_remark/scrapy.cfg: -------------------------------------------------------------------------------- 1 | # Automatically created by: scrapy startproject 2 | # 3 | # For more information about the [deploy] section see: 4 | # https://scrapyd.readthedocs.io/en/latest/deploy.html 5 | 6 | [settings] 7 | default = shopee_remark.settings 8 | 9 | [deploy] 10 | #url = http://localhost:6800/ 11 | project = shopee_remark 12 | -------------------------------------------------------------------------------- /虾皮shopee指定商品评论收集scrapy版(新加坡)/shopee_remark/shopee_remark/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Prycekim/python_spider_idea_learn_share/4e34386524b8703752a0c51f4888e4e1ef04194f/虾皮shopee指定商品评论收集scrapy版(新加坡)/shopee_remark/shopee_remark/__init__.py -------------------------------------------------------------------------------- /虾皮shopee指定商品评论收集scrapy版(新加坡)/shopee_remark/shopee_remark/__pycache__/__init__.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Prycekim/python_spider_idea_learn_share/4e34386524b8703752a0c51f4888e4e1ef04194f/虾皮shopee指定商品评论收集scrapy版(新加坡)/shopee_remark/shopee_remark/__pycache__/__init__.cpython-312.pyc -------------------------------------------------------------------------------- /虾皮shopee指定商品评论收集scrapy版(新加坡)/shopee_remark/shopee_remark/__pycache__/items.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Prycekim/python_spider_idea_learn_share/4e34386524b8703752a0c51f4888e4e1ef04194f/虾皮shopee指定商品评论收集scrapy版(新加坡)/shopee_remark/shopee_remark/__pycache__/items.cpython-312.pyc -------------------------------------------------------------------------------- /虾皮shopee指定商品评论收集scrapy版(新加坡)/shopee_remark/shopee_remark/__pycache__/pipelines.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Prycekim/python_spider_idea_learn_share/4e34386524b8703752a0c51f4888e4e1ef04194f/虾皮shopee指定商品评论收集scrapy版(新加坡)/shopee_remark/shopee_remark/__pycache__/pipelines.cpython-312.pyc -------------------------------------------------------------------------------- /虾皮shopee指定商品评论收集scrapy版(新加坡)/shopee_remark/shopee_remark/__pycache__/settings.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Prycekim/python_spider_idea_learn_share/4e34386524b8703752a0c51f4888e4e1ef04194f/虾皮shopee指定商品评论收集scrapy版(新加坡)/shopee_remark/shopee_remark/__pycache__/settings.cpython-312.pyc -------------------------------------------------------------------------------- /虾皮shopee指定商品评论收集scrapy版(新加坡)/shopee_remark/shopee_remark/items.py: -------------------------------------------------------------------------------- 1 | # Define here the models for your scraped items 2 | # 3 | # See documentation in: 4 | # https://docs.scrapy.org/en/latest/topics/items.html 5 | 6 | import scrapy 7 | 8 | 9 | class ShopeeRemarkItem(scrapy.Item): 10 | # define the fields for your item here like: 11 | # name = scrapy.Field() 12 | #交易号 13 | orderid = scrapy.Field() 14 | #商品号 15 | itemid = scrapy.Field() 16 | #用户号 17 | userid = scrapy.Field() 18 | #店铺号 19 | shopid = scrapy.Field() 20 | #星级 21 | rating_star = scrapy.Field() 22 | #用户名 23 | author_username = scrapy.Field() 24 | #商品名字 25 | product_items_name = scrapy.Field() 26 | #商品图片 27 | product_items_image = scrapy.Field() 28 | #客户主观评价 29 | user_comment = scrapy.Field() 30 | #商家回复 31 | Merchant_response = scrapy.Field() 32 | #地区 33 | region = scrapy.Field() 34 | -------------------------------------------------------------------------------- /虾皮shopee指定商品评论收集scrapy版(新加坡)/shopee_remark/shopee_remark/middlewares.py: -------------------------------------------------------------------------------- 1 | # Define here the models for your spider middleware 2 | # 3 | # See documentation in: 4 | # https://docs.scrapy.org/en/latest/topics/spider-middleware.html 5 | 6 | from scrapy import signals 7 | 8 | # useful for handling different item types with a single interface 9 | from itemadapter import is_item, ItemAdapter 10 | 11 | 12 | class ShopeeRemarkSpiderMiddleware: 13 | # Not all methods need to be defined. If a method is not defined, 14 | # scrapy acts as if the spider middleware does not modify the 15 | # passed objects. 16 | 17 | @classmethod 18 | def from_crawler(cls, crawler): 19 | # This method is used by Scrapy to create your spiders. 20 | s = cls() 21 | crawler.signals.connect(s.spider_opened, signal=signals.spider_opened) 22 | return s 23 | 24 | def process_spider_input(self, response, spider): 25 | # Called for each response that goes through the spider 26 | # middleware and into the spider. 27 | 28 | # Should return None or raise an exception. 29 | return None 30 | 31 | def process_spider_output(self, response, result, spider): 32 | # Called with the results returned from the Spider, after 33 | # it has processed the response. 34 | 35 | # Must return an iterable of Request, or item objects. 36 | for i in result: 37 | yield i 38 | 39 | def process_spider_exception(self, response, exception, spider): 40 | # Called when a spider or process_spider_input() method 41 | # (from other spider middleware) raises an exception. 42 | 43 | # Should return either None or an iterable of Request or item objects. 44 | pass 45 | 46 | def process_start_requests(self, start_requests, spider): 47 | # Called with the start requests of the spider, and works 48 | # similarly to the process_spider_output() method, except 49 | # that it doesn’t have a response associated. 50 | 51 | # Must return only requests (not items). 52 | for r in start_requests: 53 | yield r 54 | 55 | def spider_opened(self, spider): 56 | spider.logger.info("Spider opened: %s" % spider.name) 57 | 58 | 59 | class ShopeeRemarkDownloaderMiddleware: 60 | # Not all methods need to be defined. If a method is not defined, 61 | # scrapy acts as if the downloader middleware does not modify the 62 | # passed objects. 63 | 64 | @classmethod 65 | def from_crawler(cls, crawler): 66 | # This method is used by Scrapy to create your spiders. 67 | s = cls() 68 | crawler.signals.connect(s.spider_opened, signal=signals.spider_opened) 69 | return s 70 | 71 | def process_request(self, request, spider): 72 | # Called for each request that goes through the downloader 73 | # middleware. 74 | 75 | # Must either: 76 | # - return None: continue processing this request 77 | # - or return a Response object 78 | # - or return a Request object 79 | # - or raise IgnoreRequest: process_exception() methods of 80 | # installed downloader middleware will be called 81 | return None 82 | 83 | def process_response(self, request, response, spider): 84 | # Called with the response returned from the downloader. 85 | 86 | # Must either; 87 | # - return a Response object 88 | # - return a Request object 89 | # - or raise IgnoreRequest 90 | return response 91 | 92 | def process_exception(self, request, exception, spider): 93 | # Called when a download handler or a process_request() 94 | # (from other downloader middleware) raises an exception. 95 | 96 | # Must either: 97 | # - return None: continue processing this exception 98 | # - return a Response object: stops process_exception() chain 99 | # - return a Request object: stops process_exception() chain 100 | pass 101 | 102 | def spider_opened(self, spider): 103 | spider.logger.info("Spider opened: %s" % spider.name) 104 | -------------------------------------------------------------------------------- /虾皮shopee指定商品评论收集scrapy版(新加坡)/shopee_remark/shopee_remark/pipelines.py: -------------------------------------------------------------------------------- 1 | # Define your item pipelines here 2 | # 3 | # Don't forget to add your pipeline to the ITEM_PIPELINES setting 4 | # See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html 5 | 6 | 7 | # useful for handling different item types with a single interface 8 | from itemadapter import ItemAdapter 9 | import os 10 | import pandas as pd 11 | 12 | 13 | class ShopeeRemarkPipeline: 14 | 15 | def __init__(self): 16 | self.file_name = 'shopee_remarks.csv' 17 | # Check if file already exists, if not create it and write the header 18 | if not os.path.exists(self.file_name): 19 | df = pd.DataFrame(columns=[ 20 | 'orderid', 'itemid', 'userid', 'shopid', 'rating_star', 21 | 'author_username', 'product_items_name', 'product_items_image', 22 | 'user_comment', 'Merchant_response', 'region' 23 | ]) 24 | df.to_csv(self.file_name, index=False, encoding='utf-8-sig') 25 | 26 | 27 | def process_item(self, item, spider): 28 | # Convert item to DataFrame 29 | df = pd.DataFrame([dict(item)]) 30 | 31 | # Append the data to the CSV file 32 | df.to_csv(self.file_name, mode='a', index=False, header=False, encoding='utf-8-sig') 33 | print(item) 34 | return item 35 | -------------------------------------------------------------------------------- /虾皮shopee指定商品评论收集scrapy版(新加坡)/shopee_remark/shopee_remark/settings.py: -------------------------------------------------------------------------------- 1 | # Scrapy settings for shopee_remark project 2 | # 3 | # For simplicity, this file contains only settings considered important or 4 | # commonly used. You can find more settings consulting the documentation: 5 | # 6 | # https://docs.scrapy.org/en/latest/topics/settings.html 7 | # https://docs.scrapy.org/en/latest/topics/downloader-middleware.html 8 | # https://docs.scrapy.org/en/latest/topics/spider-middleware.html 9 | 10 | BOT_NAME = "shopee_remark" 11 | 12 | SPIDER_MODULES = ["shopee_remark.spiders"] 13 | NEWSPIDER_MODULE = "shopee_remark.spiders" 14 | 15 | 16 | # Crawl responsibly by identifying yourself (and your website) on the user-agent 17 | #USER_AGENT = "shopee_remark (+http://www.yourdomain.com)" 18 | 19 | # Obey robots.txt rules 20 | ROBOTSTXT_OBEY = False 21 | 22 | # Configure maximum concurrent requests performed by Scrapy (default: 16) 23 | CONCURRENT_REQUESTS = 32 24 | 25 | # Configure a delay for requests for the same website (default: 0) 26 | # See https://docs.scrapy.org/en/latest/topics/settings.html#download-delay 27 | # See also autothrottle settings and docs 28 | DOWNLOAD_DELAY = 3 29 | # The download delay setting will honor only one of: 30 | #CONCURRENT_REQUESTS_PER_DOMAIN = 16 31 | CONCURRENT_REQUESTS_PER_IP = 16 32 | 33 | # Disable cookies (enabled by default) 34 | #COOKIES_ENABLED = False 35 | 36 | # Disable Telnet Console (enabled by default) 37 | #TELNETCONSOLE_ENABLED = False 38 | 39 | # Override the default request headers: 40 | DEFAULT_REQUEST_HEADERS = { 41 | 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 42 | 'Accept-Language': 'en', 43 | 'User-Agent':'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.94 Safari/537.36', 44 | 'Referer': 'https://shopee.sg/' 45 | } 46 | 47 | # Enable or disable spider middlewares 48 | # See https://docs.scrapy.org/en/latest/topics/spider-middleware.html 49 | #SPIDER_MIDDLEWARES = { 50 | # "shopee_remark.middlewares.ShopeeRemarkSpiderMiddleware": 543, 51 | #} 52 | 53 | # Enable or disable downloader middlewares 54 | # See https://docs.scrapy.org/en/latest/topics/downloader-middleware.html 55 | #DOWNLOADER_MIDDLEWARES = { 56 | # "shopee_remark.middlewares.ShopeeRemarkDownloaderMiddleware": 543, 57 | #} 58 | 59 | # Enable or disable extensions 60 | # See https://docs.scrapy.org/en/latest/topics/extensions.html 61 | #EXTENSIONS = { 62 | # "scrapy.extensions.telnet.TelnetConsole": None, 63 | #} 64 | 65 | # Configure item pipelines 66 | # See https://docs.scrapy.org/en/latest/topics/item-pipeline.html 67 | ITEM_PIPELINES = { 68 | "shopee_remark.pipelines.ShopeeRemarkPipeline": 300, 69 | } 70 | 71 | # Enable and configure the AutoThrottle extension (disabled by default) 72 | # See https://docs.scrapy.org/en/latest/topics/autothrottle.html 73 | #AUTOTHROTTLE_ENABLED = True 74 | # The initial download delay 75 | #AUTOTHROTTLE_START_DELAY = 5 76 | # The maximum download delay to be set in case of high latencies 77 | #AUTOTHROTTLE_MAX_DELAY = 60 78 | # The average number of requests Scrapy should be sending in parallel to 79 | # each remote server 80 | #AUTOTHROTTLE_TARGET_CONCURRENCY = 1.0 81 | # Enable showing throttling stats for every response received: 82 | #AUTOTHROTTLE_DEBUG = False 83 | 84 | # Enable and configure HTTP caching (disabled by default) 85 | # See https://docs.scrapy.org/en/latest/topics/downloader-middleware.html#httpcache-middleware-settings 86 | #HTTPCACHE_ENABLED = True 87 | #HTTPCACHE_EXPIRATION_SECS = 0 88 | #HTTPCACHE_DIR = "httpcache" 89 | #HTTPCACHE_IGNORE_HTTP_CODES = [] 90 | #HTTPCACHE_STORAGE = "scrapy.extensions.httpcache.FilesystemCacheStorage" 91 | 92 | # Set settings whose default value is deprecated to a future-proof value 93 | REQUEST_FINGERPRINTER_IMPLEMENTATION = "2.7" 94 | TWISTED_REACTOR = "twisted.internet.asyncioreactor.AsyncioSelectorReactor" 95 | FEED_EXPORT_ENCODING = "utf-8" 96 | -------------------------------------------------------------------------------- /虾皮shopee指定商品评论收集scrapy版(新加坡)/shopee_remark/shopee_remark/spiders/__init__.py: -------------------------------------------------------------------------------- 1 | # This package will contain the spiders of your Scrapy project 2 | # 3 | # Please refer to the documentation for information on how to create and manage 4 | # your spiders. 5 | -------------------------------------------------------------------------------- /虾皮shopee指定商品评论收集scrapy版(新加坡)/shopee_remark/shopee_remark/spiders/__pycache__/__init__.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Prycekim/python_spider_idea_learn_share/4e34386524b8703752a0c51f4888e4e1ef04194f/虾皮shopee指定商品评论收集scrapy版(新加坡)/shopee_remark/shopee_remark/spiders/__pycache__/__init__.cpython-312.pyc -------------------------------------------------------------------------------- /虾皮shopee指定商品评论收集scrapy版(新加坡)/shopee_remark/shopee_remark/spiders/__pycache__/run.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Prycekim/python_spider_idea_learn_share/4e34386524b8703752a0c51f4888e4e1ef04194f/虾皮shopee指定商品评论收集scrapy版(新加坡)/shopee_remark/shopee_remark/spiders/__pycache__/run.cpython-312.pyc -------------------------------------------------------------------------------- /虾皮shopee指定商品评论收集scrapy版(新加坡)/shopee_remark/shopee_remark/spiders/__pycache__/shopee_remark_spider.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Prycekim/python_spider_idea_learn_share/4e34386524b8703752a0c51f4888e4e1ef04194f/虾皮shopee指定商品评论收集scrapy版(新加坡)/shopee_remark/shopee_remark/spiders/__pycache__/shopee_remark_spider.cpython-312.pyc -------------------------------------------------------------------------------- /虾皮shopee指定商品评论收集scrapy版(新加坡)/shopee_remark/shopee_remark/spiders/run.py: -------------------------------------------------------------------------------- 1 | from scrapy import cmdline 2 | 3 | cmdline.execute('scrapy crawl shopee_remark_spider --nolog'.split()) -------------------------------------------------------------------------------- /虾皮shopee指定商品评论收集scrapy版(新加坡)/shopee_remark/shopee_remark/spiders/shopee_remark_spider.py: -------------------------------------------------------------------------------- 1 | import scrapy 2 | import json 3 | from ..items import ShopeeRemarkItem 4 | 5 | 6 | 7 | class ShopeeRemarkSpiderSpider(scrapy.Spider): 8 | name = "shopee_remark_spider" 9 | allowed_domains = ["shopee.sg"] 10 | start_urls = ["https://shopee.sg/api/v2/item/get_ratings?exclude_filter=1&filter=0&filter_size=0&flag=1&fold_filter=0&itemid=22657061517&limit=6&offset=6&relevant_reviews=false&request_source=2&shopid=1006220784&tag_filter=&type=0&variation_filters="] 11 | 12 | offset = 6 13 | def parse(self, response): 14 | #提取字典 15 | items = ShopeeRemarkItem() 16 | #拿到请求结果转json 17 | res = json.loads(response.text) 18 | # print(res) 19 | #拿到评论部分,遍历每个人的评论,输送到item 20 | res_lst = res['data']['ratings'] 21 | for res_target in res_lst: 22 | #交易号 23 | items['orderid'] = res_target['orderid'] 24 | # print(items['orderid']) 25 | #商品号 26 | items['itemid'] = res_target['itemid'] 27 | # print(items['itemid']) 28 | #用户号 29 | items['userid'] = res_target['userid'] 30 | # print(items['userid']) 31 | #店铺号 32 | items['shopid'] = res_target['shopid'] 33 | # print(items['shopid']) 34 | #星级 35 | items['rating_star'] = res_target['rating_star'] 36 | # print(items['rating_star']) 37 | #用户名 38 | items['author_username'] = res_target['author_username'] 39 | # print(items['author_username']) 40 | #商品名字 41 | items['product_items_name'] = res_target['product_items'][0]['name'] 42 | # print(items['product_items_name']) 43 | ##商品图片 44 | items['product_items_image'] = res_target['product_items'][0]['image'] 45 | # print(items['product_items_image']) 46 | #客户主观评价 47 | items['user_comment'] = res_target['comment'] 48 | # print(items['user_comment']) 49 | #商家回复 50 | if 'ItemRatingReply' in res_target and 'comment' in res_target['ItemRatingReply']: 51 | items['Merchant_response'] = res_target['ItemRatingReply']['comment'] 52 | else: 53 | items['Merchant_response'] = '无' 54 | # print(items['Merchant_response']) 55 | #地区 56 | items['region'] = res_target['region'] 57 | # print(items['region']) 58 | yield items 59 | 60 | if self.offset < 300: 61 | self.offset += 6 62 | url = 'https://shopee.sg/api/v2/item/get_ratings?exclude_filter=1&filter=0&filter_size=0&flag=1&fold_filter=0&itemid=22657061517&limit=6&offset={}&relevant_reviews=false&request_source=2&shopid=1006220784&tag_filter=&type=0&variation_filters='\ 63 | .format(str(self.offset)) 64 | 65 | yield scrapy.Request(url=url,callback=self.parse) 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /虾皮shopee指定商品评论收集scrapy版(新加坡)/shopee_remark/shopee_remarks.csv: -------------------------------------------------------------------------------- 1 | orderid,itemid,userid,shopid,rating_star,author_username,product_items_name,product_items_image,user_comment,Merchant_response,region 2 | 171675491294594,22657061517,179229567,1006220784,5,da0443,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Performance:above my experience 👍👍👍 3 | Best Feature(s):volume output, quality surprisingly good 4 | Value For Money:excellent 5 | 6 | I like the quality of the product - aesthetically and audio quality. Recommended!!!",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 7 | 174835078204007,22657061517,817771634,1006220784,5,i*****x,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM Wired Earphones HIFI Earpiece with MIC for Xiaomi Samsung Vivo Oppo Huawei Phones ,sg-11134301-7rdxh-lxrntx7u4p5s71,"Value For Money:Worth it 8 | Best Feature(s):quality song good 9 | Performance:good and just nice 10 | 11 | It's almost like apple quality and feature. Worth to buy it and comfortable listening to the sound quality.",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 12 | 169969966228613,22657061517,909609,1006220784,5,benleeben,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Value For Money:yes 13 | Performance:okay 14 | Best Feature(s):super fast delivery 15 | 16 | Delivery is super fast for overseas orders. Not much base . For this price is still a good deal",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 17 | 160918265273136,22657061517,1049065740,1006220784,5,k*****y,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Value For Money:yes 18 | Best Feature(s):not try yet 19 | Performance:not try yet 20 | 21 | Item was delivered more than a week. It's cheap item. Haven't tried them yet , but I hope it's good. Thanks seller",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 22 | 174375991288476,22657061517,335213346,1006220784,5,e*****t,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,sg-11134201-7rd6h-lxak7tfe72o8c6,"Best Feature(s):clear 23 | Performance:ok 24 | Value For Money:yes 25 | 26 | Order received in a short few days. Considered very fast. It seems to work fine and well worth to buy",We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 27 | 170295708220795,22657061517,336673850,1006220784,5,u*****f,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Best Feature(s):Good audio 28 | Performance:Clear & Loud 29 | 30 | Perform as it is, audio quality not bad. Wire is a bit thin kind and audio jack is a bit loose for my samsung headphone jack. Nevertheless, ok for normal use.",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 31 | 168130688287520,22657061517,96851159,1006220784,5,bangkokinsomnia,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Best Feature(s):it’s working well 32 | Value For Money:super cheap earphones 33 | Performance:working 34 | 35 | Better than I expect. Cheap and good earphones for temporary use. Bought it for my grandmother",We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 36 | 159852616294450,22657061517,75655284,1006220784,5,h*****1,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Performance:very gd 37 | Value For Money:yes 38 | 39 | Very very gd ear piece! The sound is loud & clear too! Very very happy with my purchase. Will definitely buy more.","Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 40 | 171972911287984,22657061517,78641712,1006220784,5,b*****7,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Performance:Good 41 | Best Feature(s):Nothing fancy but does the job 42 | Value For Money:Yes....no complain about that! 43 | 44 | Worth buying if you are looking for basic use of earpiece with mic. Bought 4 for the whole family ;)",We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 45 | 173143418209256,22657061517,619728874,1006220784,5,jykam,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Best Feature(s):sound still okay and comfortable when wearing 46 | Performance:sound still okay 47 | Value For Money:totally 48 | 49 | Product is lightweight and good. Easy to bring out and gooddd",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 50 | 167327970259271,22657061517,262686417,1006220784,5,liquidme,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Performance:Good 51 | Best Feature(s):Good 52 | Value For Money:Good 53 | 54 | Fast delivery, Good quality, very satisfied.","Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 55 | 174130744262364,22657061517,89231347,1006220784,5,wongyewching,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,sg-11134201-7rd6h-lxak7tfe72o8c6,"Well pack. Good price. Hope all 3 ear pieces work well. 56 | Thank you.",We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 57 | 173854287222775,22657061517,118771384,1006220784,5,n*****n,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,sg-11134201-7rd6h-lxak7tfe72o8c6,"Value For Money:Yes 58 | Performance:Good 59 | Best Feature(s):Nice Colour 60 | 61 | I love it but too fragile wiring. So use it be careful. I've tried and tested.",We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 62 | 163706590238362,22657061517,191556088,1006220784,5,y*****q,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Best Feature(s):normal earpiece 63 | Performance:depend on gadgets 64 | Value For Money:yes 65 | 66 | Thanks for the speedy delivery 🚚",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 67 | 161570170222388,22657061517,105566422,1006220784,5,ng1489,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Headphones well received, tested sounds is good. Just to replace the old headphones set","Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 68 | 170609954249876,22657061517,1178367842,1006220784,5,jy96kha34h,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Value For Money:yes 69 | Best Feature(s):ok 70 | Performance:ok 71 | 72 | Work well , cheap and fast delivery . I will buy again for my friend. Thnks","Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 73 | 167320637210853,22657061517,300945554,1006220784,3,j*****e,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"The sound quality is okay. 74 | 75 | Unfortunately the pink one is broken at a spot and the cable “fastener” is missing. 76 | The cable “fastener” for the black one is not cut properly- can’t slot in the cable .",无,SG 77 | 170751915290660,22657061517,872599792,1006220784,4,abdulmoktharbinmohd,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Performance:ok 78 | Value For Money:ok 79 | Best Feature(s):ok 80 | 81 | Received in Good Condition.👍",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 82 | 172671305228707,22657061517,191143765,1006220784,5,n*****a,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Value For Money:yes 83 | Performance:okay 84 | 85 | The colour is pastel pink and tested it seems good too. 👍🏻",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 86 | 174110265274868,22657061517,331231822,1006220784,5,h*****q,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,sg-11134201-7rd6h-lxak7tfe72o8c6,really good price online. thanks for the quick delivery as always,Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 87 | 165950790237722,22657061517,157870238,1006220784,5,rodzishot,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Performance:okie 88 | Value For Money:soso 89 | Best Feature(s):ok 90 | 91 | Came really fast. However, cable material is very thin, I hope it can last long term.",We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 92 | 162689235250423,22657061517,75655284,1006220784,4,h*****1,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Value For Money:ok 93 | 94 | Cheap but it's doesn't seem to last long. Bought another to test it out. Spoiled the first one. But the sound not bad.",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 95 | 163989068272479,22657061517,84669018,1006220784,5,j*****5,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Performance:good 96 | Best Feature(s):good 97 | Value For Money:yes 98 | 99 | Received in good condition. Parcel was left on the doorstep luckily not stepped on.","Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 100 | 167198964247076,22657061517,5866553,1006220784,5,r*****a,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Best Feature(s):good 101 | Value For Money:yes 102 | Performance:good 103 | 104 | Like the color n value for money",We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 105 | 171598540209080,22657061517,54643631,1006220784,5,j*****w,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Sound quality is not the best, but I mean from the price it shld b pretty obvious. Anw one side spoilt within 1 week of using",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 106 | 173957739236358,22657061517,503766965,1006220784,5,michellegn1308,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,sg-11134201-7rd6h-lxak7tfe72o8c6,"Value For Money:good 107 | Performance:good 108 | Best Feature(s):good 109 | 110 | Delivered in good condition, the sound is good and value for money.",We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 111 | 165648904208356,22657061517,294433212,1006220784,1,majorawesome,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Performance:reasonable 112 | Value For Money:tok gong 113 | Best Feature(s):cheap 114 | 115 | Does not fit snugly in ear but cannot comppain due to price.",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 116 | 173505034244804,22657061517,268548468,1006220784,5,m*****m,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,Arrived very fast. Sound quality is reasonable for the price.,Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 117 | 165815481244462,22657061517,42676206,1006220784,1,shhirwinn,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Performance:died after 1 day 118 | Value For Money:nah 119 | Best Feature(s):day 1 of using only. 120 | 121 | Valued at $2.16, for sure it’s a great price for an earpiece. 122 | 123 | First day of using was great, sound was loud, mic was clear. But after 1 full day of use, it all when down hill. 124 | 125 | 2nd day onwards, 126 | 127 | when plug in my volume button automatically goes down by itself to mute. When I up the volume it just continues to decrease the volume by itself. 128 | 129 | Left side slowly got cackling sound followed by silence but in actual fact right side is loud and clear. 130 | 131 | Mic is no longer clear and people aren’t able to hear what I have got to say anymore…. 132 | 133 | Not sure if I got a lemon… I rather saved the $2.16 and buy something else. :( really wanted this to work","Dear customer, we are sorry to receive your negative review. In order to solve the problem you encountered, we have contacted you and you can communicate with the customer service agent in time. We will definitely give you a satisfactory result.",SG 134 | 156616821228711,22657061517,29389858,1006220784,5,j*****8,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,Received in good condition. Quality not bad. Thumbs up for the seller. Hooray! Quality on the cheaper side.,We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 135 | 173467679293828,22657061517,13658628,1006220784,5,t*****1,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Performance:Ok 136 | Value For Money:Ok 137 | 138 | Tested the earphone works but haven’t tested the mic yet. The sound is quite clear. However, the cable at one side of the earphone is loose. There’s sound when you shake it. I think it may come off after a while. Don’t expect high quality with such low price.","Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 139 | 166841017255377,22657061517,196776143,1006220784,5,d*****2,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Performance:good 140 | Value For Money:yes 141 | 142 | Quality is good. Recommend to buy as price is reasonable.",We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 143 | 162709081236257,22657061517,263010761,1006220784,5,m*****e,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Performance:acceptable 144 | Value For Money:worth the money 145 | 146 | Good for meeting and listening to music","Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 147 | 174441838222959,22657061517,141065250,1006220784,5,mark7076a,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,sg-11134201-7rd6h-lxak7tfe72o8c6,"Best Feature(s):ok 148 | 149 | Placed order and item received promptly. Tested in working condition and value for money. I am happy for the purchase. Thanks",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 150 | 174018150298485,22657061517,154070525,1006220784,5,n*****p,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,sg-11134201-7rd6h-lxak7tfe72o8c6,"Best Feature(s):Price 151 | Performance:Decent 152 | Value For Money:Very Good 153 | 154 | Bought it on 7.7 for work purposes. Works out of the box",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 155 | 175066196226556,22657061517,686703702,1006220784,5,40z1fiym1r,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM Wired Earphones HIFI Earpiece with MIC for Xiaomi Samsung Vivo Oppo Huawei Phones ,sg-11134301-7rdwb-lxultasfukio3b,"Value For Money:good 156 | Performance:good 157 | Best Feature(s):there volume control 158 | 159 | Value for money. Simple and effective. Still got vol control. 👍",We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 160 | 163175395287227,22657061517,103885108,1006220784,5,g*****i,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,Ordered 3 Feb. Received 9 Feb. Bought on flash sale. Good value.,"Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 161 | 173810523253448,22657061517,219483391,1006220784,5,zamhayabe,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,sg-11134201-7rd6h-lxak7tfe72o8c6,"Value For Money:yes 162 | Performance:yet to try 163 | 164 | Looks good but yet to try and the price is great",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 165 | 173435802247321,22657061517,305357974,1006220784,5,mrlord1992,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Best Feature(s):the color of the earpiece is nice and it's so lightweight 166 | Performance:ok not that good but it's cheap 167 | Value For Money:decent value for money 168 | 169 | Cheap and decent use for earpiece.",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 170 | 161333577227596,22657061517,341766492,1006220784,5,2*****n,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Best Feature(s):sound 171 | Value For Money:yes 172 | Performance:Good 173 | 174 | Should be ok bah…cos not yet try 😅thank u",We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 175 | 159942048299528,22657061517,872599792,1006220784,4,abdulmoktharbinmohd,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Performance:ok 176 | Value For Money:ok 177 | Best Feature(s):ok 178 | 179 | Received with good condition. Happy with the purchase 👍","Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 180 | 168222619260924,22657061517,163607514,1006220784,5,kangningkain,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Performance:good 181 | Value For Money:very 182 | Best Feature(s):cheap 183 | 184 | Item delivered as described. Condition is good delivery is fast","Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 185 | 160788460251736,22657061517,115678353,1006220784,5,k*****2,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Best Feature(s):👍 186 | Performance:👍 187 | Value For Money:👍 188 | 189 | Fast delivery and received in good condition. Good quality for price. Recommended.",We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 190 | 163477485274179,22657061517,14723270,1006220784,5,s*****a,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Value For Money:yes 191 | Performance:good 192 | Best Feature(s):good 193 | 194 | fast delivery!!! Good product packaging!!! The earpiece working well 👍",We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 195 | 165514460295043,22657061517,34350592,1006220784,5,m*****e,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Performance:good 196 | Best Feature(s):good 197 | Value For Money:good 198 | 199 | Good quality item…fast delivery and very good price compared to any retail shop","Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 200 | 169389212288481,22657061517,326754178,1006220784,5,yerielnah,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Best Feature(s):Works well 201 | Value For Money:Yes 202 | Performance:Good 203 | 204 | Good quality for the price, will buy again if needed",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 205 | 161254004216294,22657061517,778954134,1006220784,5,yoo_kyluarr,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Value For Money:ya la 206 | Best Feature(s):havent tr yetid 207 | Performance:quite fast 208 | 209 | i’m going on the boat to the lake tomorrow and",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 210 | 174198445268266,22657061517,21564679,1006220784,5,r*****p,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,sg-11134201-7rd6h-lxak7tfe72o8c6,Items well received in sealed packaging. Tested all 3 earpiece in working condition. Purchased many times repeated orders. Thank you seller 👍,Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 211 | 157765184225018,22657061517,184399121,1006220784,5,l*****g,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Performance:good 212 | Best Feature(s):good 213 | Value For Money:good 214 | 215 | Item well received within one week. Goos",We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 216 | 173857386230908,22657061517,264702772,1006220784,5,l*****_,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,sg-11134201-7rd6h-lxak7tfe72o8c6,"Value For Money:Yes 217 | Performance:Okay 218 | 219 | Pretty decent for the price, audio gets affected if u touch the plug in while its plugged in. hope it lasts long tho","Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 220 | 171345232247997,22657061517,1025113072,1006220784,5,al7kfb9_eg,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"The headphones came within a day of order. Also, the black headphones is in good condition.","Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 221 | 168405318284842,22657061517,162664366,1006220784,5,r*****n,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"cheap price, works okay as well and the good thing is got the mic to use when talking",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 222 | 169437778282450,22657061517,97802646,1006220784,5,k*****y,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Value for money, quality of sound is what u get for the price paid. Decent quality","Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 223 | 160930008249787,22657061517,104113219,1006220784,5,sendfast2me88,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,This quality earphones fits snugly and its sound clarity is sufficiently good.,We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 224 | 160915162216968,22657061517,371935493,1006220784,5,lerherher,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Delivered in 8 days in good condition. Have used this brand before. Sound quality is good enough. Thank you, Seller.",We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 225 | 174004878206001,22657061517,233065388,1006220784,5,i*****_,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,sg-11134201-7rd6h-lxak7tfe72o8c6,"Performance:Good 226 | 227 | Delivery was fast. The items were working well. Except for one where the volume button isn’t working. Overall okay :) thanks",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 228 | 174879733218955,22657061517,2332121,1006220784,5,bdazzleqatz,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM Wired Earphones HIFI Earpiece with MIC for Xiaomi Samsung Vivo Oppo Huawei Phones ,sg-11134301-7rdxh-lxrntx7u4p5s71,"Performance:hopefully work well for my office video conference 229 | Best Feature(s):looks like apple ony in black 230 | Value For Money:definitely",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 231 | 169637271283028,22657061517,291110997,1006220784,5,yinggxingg,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"sound has no bass but for the price, its reasonable. the delivery was quite okay",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 232 | 169994638264569,22657061517,55559395,1006220784,1,tavright,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Value For Money:No 233 | Best Feature(s):Cheap 234 | 235 | The mic doesn’t really pick up voices and the sounds are bad",无,SG 236 | 173981447292005,22657061517,42643836,1006220784,5,c*****z,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,sg-11134201-7rd6h-lxak7tfe72o8c6,Tested and working fine.. the colour is sweet pink and nice .,We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 237 | 157519077255208,22657061517,61264030,1006220784,5,n*****h,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,Used it already on my laptop. Works fine. Volume button is functional. Great 👍🏻,"Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 238 | 166058929230887,22657061517,71388028,1006220784,5,shaaawnn,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Item came fast , sound quality ok, value for money",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 239 | 173426917293904,22657061517,256154726,1006220784,4,r*****y,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Best Feature(s):The product came individually wrapped. 240 | Value For Money:Purchased it on sale 241 | Performance:Average performance work as it's supposed to be",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 242 | 167620182288491,22657061517,18478679,1006220784,5,m*****l,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Performance:ok 243 | Best Feature(s):ok 244 | Value For Money:ok 245 | 246 | Works well and definitely delivery was fast. Thanks","Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 247 | 167731084227063,22657061517,392204552,1006220784,5,m*****e,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Best Feature(s):Normal earphones 248 | Value For Money:Okay 249 | Performance:Normal 250 | 251 | Brought this for a friend as standby.",We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 252 | 173014454292571,22657061517,948715479,1006220784,5,opteieobgm,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Best Feature(s):pink 253 | Performance:great 254 | Value For Money:yes 255 | 256 | Received in good condition. First time this ESSAGER Headphone pink color. Love it.",We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 257 | 171171729297210,22657061517,258676941,1006220784,3,t75cxst7ez,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,Thanks saller...item come good condition all...i like...fast respon and dilevery too...recomended shop,"Dear customer, we are sorry to receive your negative review. In order to solve the problem you encountered, we have contacted you and you can communicate with the customer service agent in time. We will definitely give you a satisfactory result.",SG 258 | 174883338233432,22657061517,280376470,1006220784,5,c*****9,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM Wired Earphones HIFI Earpiece with MIC for Xiaomi Samsung Vivo Oppo Huawei Phones ,sg-11134301-7rdxh-lxrntx7u4p5s71,Fast delivery and item recieved was in working condition. Totally worth it,"Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 259 | 164748804258941,22657061517,616935092,1006220784,5,g9rz2sff7b,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Value For Money:yes 260 | Best Feature(s):sound comparable to more expensive brands 261 | Performance:good 262 | 263 | Neat and simple design and delivers good quality sound",We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 264 | 165033126274693,22657061517,1149206273,1006220784,5,jonathantan783,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Best Feature(s):Good 265 | Performance:Good 266 | Value For Money:Good 267 | 268 | Fast delivery. Highly recommended. Will buy again if needed.","Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 269 | 170327401281236,22657061517,71699206,1006220784,5,p*****e,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Items received in good order. 270 | For the price .. it's consider good.","Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 271 | 156425842223736,22657061517,141472,1006220784,5,k*****g,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Quite fast delivery. 272 | Super good value for money, average sound quality.","Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 273 | 174197317276558,22657061517,206778394,1006220784,5,vin11117,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,sg-11134201-7rd6h-lxak7tfe72o8c6,Bought two received in good condition and tested working condition . Sound exceptable. First time purchase. Four days delivery .,"Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 274 | 163774855223405,22657061517,489917,1006220784,5,kenny.teo,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Performance:haven't try 275 | Best Feature(s):haven't try 276 | Value For Money:okay👌🏼 277 | 278 | Fast delivery. Haven't try. Hope it works",We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 279 | 167633628233033,22657061517,1014411461,1006220784,5,w*****e,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"colour is true to picture, quite cheap and quality is good for its price","Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 280 | 157364965225037,22657061517,223798136,1006220784,5,s*****7,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Value For Money:ok 281 | Best Feature(s):ok 282 | Performance:ok 283 | 284 | First time purchase. Item received with reasonable packaging and working well. Thanks seller","Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 285 | 173002768203924,22657061517,533840,1006220784,5,s*****1,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Best Feature(s):ok 286 | Value For Money:cheap 287 | Performance:works 288 | 289 | 1 week delivery. ok quality well packaged. thanks!","Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 290 | 173705923217240,22657061517,568425838,1006220784,5,j*****y,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,Fast delivery in inky 4 days have yet to try but should work well,"Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 291 | 174235092286885,22657061517,113528261,1006220784,5,jeanmichelle99,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,sg-11134201-7rd6h-lxak7tfe72o8c6,"Performance:bass sound , soft in volume . 292 | Best Feature(s):ok 293 | Value For Money:paid as what it worth.",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 294 | 160889329258076,22657061517,1010878015,1006220784,5,akhwatzahidah,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Best Feature(s):good 295 | Value For Money:good 296 | 297 | Good to use the earpiece","Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 298 | 173630765295826,22657061517,29205270,1006220784,5,shanooklim,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Best Feature(s):good 299 | Performance:good 300 | Value For Money:good 301 | 302 | Fast delivery came within 4 days,really good quality for it's price",We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 303 | 156423590290331,22657061517,55891887,1006220784,5,fyfieangel,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Best Feature(s):good 304 | Performance:good 305 | Value For Money:good 306 | 307 | Fast delivery. Very cheap. I love the product. Thank you","Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 308 | 157966232272514,22657061517,203408751,1006220784,5,r*****2,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Good quality product. 309 | Well made and serve its purpose well. 310 | Great seller with prompt delivery. 311 | Highly recommended.",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 312 | 156431286227500,22657061517,203408751,1006220784,5,r*****2,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Good quality product. 313 | Well made and serve its purpose well. 314 | Great seller with prompt delivery. 315 | Highly recommended.","Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 316 | 156276137286039,22657061517,880736769,1006220784,5,rr4mune,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Performance:good 317 | Best Feature(s):audio 318 | Value For Money:yes 319 | 320 | good quality good price will buy again thanks seller",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 321 | 173853978274301,22657061517,904508592,1006220784,5,afiqdinie007,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,sg-11134201-7rd6h-lxak7tfe72o8c6,"Best Feature(s):best feature i can hear the item 322 | Performance:alrighty performance 323 | Value For Money:well value",We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 324 | 161929112243590,22657061517,29220441,1006220784,5,tklim2017,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Performance:Good 325 | Best Feature(s):Simple 326 | Value For Money:Yes 327 | 328 | Sound quality is very much better than other",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 329 | 167148992241376,22657061517,105374979,1006220784,5,richsjs,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Value For Money:good 330 | Performance:good 331 | 332 | Fast delivery . Cheap & good . Can buy",We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 333 | 156701896279663,22657061517,537899104,1006220784,5,1580_xok4h,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Performance:8/10 334 | Value For Money:$2 quite cheap for a good quality 335 | Best Feature(s):lower and higher the volume. I think mine is a bit not working. cause the + button works nice but the - button is abit harder 336 | 337 | Highly recommended for those who watch anime, kdrama, cdrama, the background of course can hear but the quality best",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 338 | 172505002275468,22657061517,73834785,1006220784,5,p*****_,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Best Feature(s):similar to apple earpiece 339 | Value For Money:yes 340 | Performance:decent audio but mic is poor","Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 341 | 170882417219856,22657061517,73172297,1006220784,5,f*****a,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Bought it for my helper,received in good condition m fast delivery",We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 342 | 170393694216411,22657061517,306845513,1006220784,5,c*****0,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,Received in good condition. Fast n easy collection. Quality looks good.,"Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 343 | 166424255257063,22657061517,1168742319,1006220784,5,b*****h,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Value For Money:10/10 344 | Performance:works well for the price, audio does not break","Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 345 | 162862732217323,22657061517,347705263,1006220784,5,ijohar,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Received in good condition ,yet to used, hope it’s work,reasonable pricing",We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 346 | 162708058213562,22657061517,899819114,1006220784,5,y*****k,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,Item received as description quality not bad thank you seller,We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 347 | 166684194208319,22657061517,294741477,1006220784,5,l*****h,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Performance:works well 348 | Best Feature(s):fast delivery 349 | Value For Money:good 350 | 351 | Bought 2 at one go. ",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 352 | 175359708260232,22657061517,581422223,1006220784,3,a*****g,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM Wired Earphones HIFI Earpiece with MIC for Xiaomi Samsung Vivo Oppo Huawei Phones ,sg-11134301-7rdwb-lxultasfukio3b,"Super fast delivery. But sound quality wasn’t great. Louder in the left ear and softer on the right, so cannot use both sides at any one time or u feel unbalanced. Guess the quality u get is really what u pay for",无,SG 353 | 170636147240894,22657061517,646796612,1006220784,4,l*****a,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"The sound is not so good as no base sound. As the price is cheap n the quality is not that good. Sorry. 354 | Anyways..thnx",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 355 | 164458836259743,22657061517,142046350,1006220784,5,e*****6,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Performance:good 356 | Value For Money:definitely 357 | Best Feature(s):ok 358 | 359 | Bought as the current one is malfunctioning. Will come back for more if needed. Thanks seller.",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 360 | 159420358274740,22657061517,141842339,1006220784,5,t*****9,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Performance:good 361 | Value For Money:yeah 362 | 363 | good works good enough esp for price. Volume button doesn’t rlly work",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 364 | 167572293202149,22657061517,262642770,1006220784,5,veron2113,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Value For Money:yes 365 | Performance:yes 366 | Best Feature(s):cheap 367 | 368 | Work as normal. Fits perfectly to ear. Delivery took some time.",Hello! Thank you very much for your love and recognition of us. Your satisfaction is our greatest reward. We will work harder and look forward to your next visit.,SG 369 | 167463816283918,22657061517,257290006,1006220784,5,mxpwvyy7dh,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Performance:Average 370 | 371 | Tried it out but the sound is average but no complaints considering the price",We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 372 | 173340064243473,22657061517,997019653,1006220784,1,k4w1nthr4,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Performance:bad 373 | Value For Money:fine 374 | Best Feature(s):nothing 375 | 376 | one side of the earpiece was malfunctioning. total scam","Dear customer, we are sorry to receive your negative review. In order to solve the problem you encountered, we have contacted you and you can communicate with the customer service agent in time. We will definitely give you a satisfactory result.",SG 377 | 173778800283326,22657061517,956364033,1006220784,3,drinaleaw,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,sg-11134201-7rd6h-lxak7tfe72o8c6,"Performance:Slightly below average 378 | 379 | I think the audio is alright given the price of the product","Dear customer, we are sorry to receive your negative review. In order to solve the problem you encountered, we have contacted you and you can communicate with the customer service agent in time. We will definitely give you a satisfactory result.",SG 380 | 168745618244067,22657061517,468977535,1006220784,3,yuh3ngg,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Best Feature(s):normal earpiece, quality not the best but its good for its money","Dear customer, we are sorry to receive your negative review. In order to solve the problem you encountered, we have contacted you and you can communicate with the customer service agent in time. We will definitely give you a satisfactory result.",SG 381 | 169696292290951,22657061517,212328224,1006220784,5,dawgyinyo,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Performance:good performance 382 | Value For Money:yes..Value 💰 383 | Best Feature(s):also good 384 | 385 | Will buy again 😍","Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 386 | 163910834256312,22657061517,714586278,1006220784,4,erosiexoxoagustd,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Best Feature(s):That it’s pink 387 | Value For Money:Eh it’s okay 388 | Performance:Pretty good","Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 389 | 172995315292768,22657061517,646046980,1006220784,5,ayu786,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,Nice! Fast delivery too. Highly recommended. Thank u Seller! ⭐️⭐️⭐️⭐️⭐️⭐️⭐️,"Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 390 | 173793458210423,22657061517,509753423,1006220784,5,wsplpnvf2p,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,sg-11134201-7rd6h-lxak7tfe72o8c6,"Value For Money:good 391 | Performance:good 392 | Best Feature(s):it's like the apple. ear piece",We have received your praise. We are honored to receive your affirmation and look forward to serving you again.,SG 393 | 170008225296577,22657061517,1083885826,1006220784,5,glennlim101,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Value For Money:good 394 | Performance:good 395 | Best Feature(s):good 396 | 397 | Good good good good","Dear customer, I am glad that you like our products. Your praise is the greatest support for us. Have a nice day.",SG 398 | 173980933288636,22657061517,9700914,1006220784,2,a*****x,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,sg-11134201-7rd6h-lxak7tfe72o8c6,bought 1 pink and 1 black earpiece. the pink one is okay but the black one the wire was broken hence a refund was given. it’s a ok earpiece to listen but not v good sound quality,"Dear customer, we are sorry to receive your negative review. In order to solve the problem you encountered, we have contacted you and you can communicate with the customer service agent in time. We will definitely give you a satisfactory result.",SG 399 | 171445662254360,22657061517,847972,1006220784,3,paulinelim,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Performance:I'm using it for laptop audio but the output sound requires some adjusting in terms of physical connection; input sound seems to be weak as others in a call could hardly hear me. 400 | Value For Money:Ok if just want a cheap and simple headphone.","Dear customer, we are sorry to receive your negative review. In order to solve the problem you encountered, we have contacted you and you can communicate with the customer service agent in time. We will definitely give you a satisfactory result.",SG 401 | 171964632276810,22657061517,174111796,1006220784,1,cicobuff,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Performance:Bad build quality. Sound keeps breaking and the wire is very thin and flimsy. The connector is bad and have to be adjusted because the sound is bad. 402 | Best Feature(s):None 403 | Value For Money:Not good no matter how cheap it is.","Dear customer, we are sorry to receive your negative review. In order to solve the problem you encountered, we have contacted you and you can communicate with the customer service agent in time. We will definitely give you a satisfactory result.",SG 404 | 167038427281953,22657061517,860686388,1006220784,1,johannahkoh,ESSAGER S320 Stereo Bass Headphone In-Ear 3.5MM HiFi with MIC for Mobile Phones,cn-11134301-7qukw-lkhu6608cs6u9e,"Value For Money:it’s ok 405 | Best Feature(s):audio 406 | Performance:poor 407 | 408 | The internal wire connection is messed up and that one side can only work if the wire is in a certain position.",无,SG 409 | -------------------------------------------------------------------------------- /虾皮shopee指定商品评论收集spider/readme.txt: -------------------------------------------------------------------------------- 1 | ## 使用说明 2 | 3 | 本程序是对跨境电商平台shopee指定商品页面评论爬虫学习,属于入门版无需登录,验证 4 | 5 | 代码仅供参考,本项目仅供学习和研究使用,仅限于学习交流,切勿用于商业用途,如有侵权,请及时联系作者删除 6 | 7 | 如有小伙伴,有更好的建议或不明白的部分,欢迎随时联系我进行讨论 8 | 9 | -------------------------------------------------------------------------------- /虾皮shopee指定商品评论收集spider/shopee_targeting_products_comment_spider.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import re 3 | import time 4 | import random 5 | from ua_info import ua_list 6 | import pandas as pd 7 | import json 8 | import os 9 | 10 | # 定义一个spider类 11 | class shopee_Spider: 12 | # 初始化 13 | # 定义初始页面url 14 | def __init__(self,shop_id,product_id,page_num,input_type): 15 | self.url = 'https://shopee.tw/api/v2/item/get_ratings?exclude_filter=1&filter=0&filter_size=0&flag=1&fold_filter=0&itemid={}&limit=6&offset={}&relevant_reviews=false&request_source=2&shopid={}&tag_filter=&type={}&variation_filters=' 16 | #店铺id 17 | self.shop_id = shop_id 18 | #用户选择的商品id 19 | self.product_id = product_id 20 | #用户要获取的页数 21 | self.page_num = page_num 22 | #用户选择的评论类型 23 | self.input_type = input_type 24 | #存储文件名 25 | self.file_name = 'shopee_remarks.csv' 26 | #提前创建好空的csv文件用于存储 27 | if not os.path.exists(self.file_name): 28 | df = pd.DataFrame(columns=['交易号', '商品号', '用户号', '店铺号', '星级','用户名','商品名字','商品图片','客户主观评价','商家回复','地区']) 29 | df.to_csv(self.file_name, index=False, encoding='utf-8-sig') 30 | 31 | 32 | 33 | # 请求函数 34 | def get_response(self,url): 35 | headers = {'User-Agent':random.choice(ua_list)} 36 | response = requests.get(url, headers=headers,verify=False) 37 | if response.status_code == 200: 38 | data = json.loads(response.text) 39 | self.parse_response(data) 40 | else: 41 | print("请求失败,状态码:", response.status_code) 42 | return response.status_code 43 | 44 | 45 | 46 | # 解析函数---JSON---数据存储进csv 47 | def parse_response(self,response_data): 48 | #创建一个空的容器 49 | shopee_data = [] 50 | #提取评论中需要的部分 51 | res_lst = response_data['data']['ratings'] 52 | #循环遍历 53 | for res_target in res_lst: 54 | #交易号 55 | orderid = res_target['orderid'] 56 | #商品号 57 | itemid = res_target['itemid'] 58 | #用户号 59 | userid = res_target['userid'] 60 | #店铺号 61 | shopid = res_target['shopid'] 62 | #星级 63 | rating_star = res_target['rating_star'] 64 | #用户名 65 | author_username = res_target['author_username'] 66 | #商品名字 67 | product_items_name = res_target['product_items'][0]['name'] 68 | ##商品图片 69 | product_items_image= res_target['product_items'][0]['image'] 70 | #客户主观评价 71 | user_comment = res_target['comment'] 72 | #商家回复 73 | if 'ItemRatingReply' in res_target and 'comment' in res_target['ItemRatingReply']: 74 | Merchant_response = res_target['ItemRatingReply']['comment'] 75 | else: 76 | Merchant_response = '无' 77 | #地区 78 | region= res_target['region'] 79 | 80 | shopee_data.append([orderid, itemid, userid, shopid,rating_star,author_username,product_items_name,product_items_image,user_comment,Merchant_response,region]) 81 | 82 | 83 | new_data = pd.DataFrame(shopee_data, columns=['交易号', '商品号', '用户号', '店铺号', '星级','用户名','商品名字','商品图片','客户主观评价','商家回复','地区']) 84 | 85 | print(new_data) 86 | 87 | self.save_data(new_data) 88 | 89 | #存储函数 90 | def save_data(self,new_data): 91 | new_data.to_csv(self.file_name, mode='a', index=False, header=False, encoding='utf-8-sig') 92 | 93 | 94 | 95 | # 主函数 96 | def run(self): 97 | offset = 0 98 | #个悲剧用户输入参数拼接url 99 | for self.page in range(1, self.page_num + 1): 100 | offset = offset + 6 101 | #拼接生成url 102 | print(offset) 103 | if self.input_type in {'0','1','2','3','4','5'}: 104 | url = self.url.format(str(self.product_id),str(offset),str(self.shop_id),str(self.input_type)) 105 | else: 106 | return print('请选择类型') 107 | print(url) 108 | #启动请求函数 109 | self.get_response(url) 110 | time.sleep(1) 111 | 112 | print('执行完毕') 113 | 114 | 115 | 116 | 117 | # 以脚本方式启动 118 | if __name__ == '__main__': 119 | # 使用正则表达式提取商品ID 120 | print("给我一个商品地址") 121 | product_id_url = input() 122 | print('\n选择要获取的评论类型(输入对应编码,如:选择五颗星就输入5):\n###########\n#全部评论: 0\n##五颗星: 5\n##四颗星: 4\n##三颗星: 3\n##两颗星: 2\n##一颗星: 1\n') 123 | input_type = input() 124 | print("输入您想要获取几页评论:") 125 | page_num = input() 126 | product_pattern = r"i\.\d+\.(.*?)\?sp_atk" 127 | shop_pattern = r"i\.(.*?)\." 128 | shop_match = re.search(shop_pattern, product_id_url) 129 | product_match = re.search(product_pattern, product_id_url) 130 | if shop_match and product_match: 131 | shop_id = shop_match.group(1) 132 | product_id = product_match.group(1) 133 | print("商品id是:" + product_id ) 134 | print("店铺id是:" + shop_id ) 135 | print("------即将获取-----" + page_num+"页------") 136 | print("准备启动!") 137 | time.sleep(2) 138 | elif shop_match is None: 139 | print("没有找到店铺id,确认商品链接是否正确,若确认商品链接没有问题,请联系管理员或开发人员!!!") 140 | time.sleep(10) 141 | elif product_match is None: 142 | print("没有找到商品id,确认商品链接是否正确,若确认商品链接没有问题,请联系管理员或开发人员!!!") 143 | time.sleep(10) 144 | try: 145 | #传参:id/页数,然后启动爬虫 146 | spider = shopee_Spider(shop_id,product_id,int(page_num),str(input_type)) 147 | spider.run() 148 | except Exception as e: 149 | print("错误:",e) 150 | 151 | print('程序执行完毕') 152 | 153 | -------------------------------------------------------------------------------- /虾皮shopee指定商品评论收集spider/ua_info.py: -------------------------------------------------------------------------------- 1 | ua_list = [ 2 | 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Maxthon 2.0', 3 | 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_0) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11', 4 | 'User-Agent:Opera/9.80 (Windows NT 6.1; U; en) Presto/2.8.131 Version/11.11', 5 | 'Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1', 6 | 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)', 7 | 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50', 8 | 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0', 9 | 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1', 10 | 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1', 11 | 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0.1) Gecko/20100101 Firefox/4.0.1', 12 | ] --------------------------------------------------------------------------------