昨天前天按F5没抢到 有点不甘心,下午撸了个简单的脚本监控,晚上抢到了,舒服了。
- import winsound
- import requests
- import time
- is_huo = False
- header={'User-agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36'}
- while not is_huo:
- response = requests.get(url='https://www.moack.co.kr/cart.php?a=add&pid=60', headers=header)
- print(response.encoding)
- if 'Out of Stock' in str(response.content):
- print("*"*30)
- time.sleep(5)
- else:
- is_huo = True
- while is_huo:
- winsound.Beep(600,1000)
- time.sleep(1)
比较简单的代码

5秒检测一次,有货就会滴滴响