| 81 | |
| 82 | # 秒杀详情页获取商品数据 |
| 83 | def getGoodMess(self,count=10): |
| 84 | taskUrl = f'https://msec.opposhop.cn/goods/v1/SeckillRound/goods/{random.randint(100,250)}' # 随机商品 |
| 85 | headers = { |
| 86 | 'clientPackage': 'com.oppo.store', |
| 87 | 'Host': 'msec.opposhop.cn', |
| 88 | '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', |
| 89 | 'Content-Type': 'application/x-www-form-urlencoded', |
| 90 | 'Connection': 'keep-alive', |
| 91 | 'User-Agent': 'okhttp/3.12.12.200sp1', |
| 92 | 'Accept-Encoding': 'gzip', |
| 93 | } |
| 94 | params = { |
| 95 | 'pageSize':count + random.randint(1,3) |
| 96 | } |
| 97 | response = self.sess.get(url=taskUrl,headers=headers,params=params).json() |
| 98 | if response['meta']['code'] == 200: |
| 99 | return response |
| 100 | |
| 101 | def viewGoods(self, count,dic=None): |
| 102 | headers = { |