| 145 | |
| 146 | # 秒杀详情页获取商品数据 |
| 147 | def getGoodMess(self,count=10): |
| 148 | taskUrl = f'https://msec.opposhop.cn/goods/v1/SeckillRound/goods/{random.randint(100,250)}' # 随机商品 |
| 149 | headers = { |
| 150 | 'clientPackage': 'com.oppo.store', |
| 151 | 'Host': 'msec.opposhop.cn', |
| 152 | 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', |
| 153 | 'Content-Type': 'application/x-www-form-urlencoded', |
| 154 | 'Connection': 'keep-alive', |
| 155 | 'User-Agent': 'okhttp/3.12.12.200sp1', |
| 156 | 'Accept-Encoding': 'gzip', |
| 157 | } |
| 158 | params = { |
| 159 | 'pageSize':count + random.randint(1,3) |
| 160 | } |
| 161 | response = self.sess.get(url=taskUrl,headers=headers,params=params).json() |
| 162 | if response['meta']['code'] == 200: |
| 163 | return response |
| 164 | |
| 165 | # 整合每日浏览、分享、推送数据 |
| 166 | def dailyTask(self): |