前记:一个农药代练的同学找到我,说代练抢不到单😢,想让我帮他写个程序:如果有新订单就提醒他去抢单。这里爬取王者农药代练通最新订单信息,代码只写一个Demo,爬取苹果微信最新的20条订单信息,大家可以接着改。
订单接口URL:https://server.dailiantong.com/API/AppService.ashx?Action=LevelOrderList&callback=callback&IsPub=1&GameID=107&ZoneID=1033&ServerID=0&SearchStr=&Sort_Str=&PageIndex=1&PageSize=20&Price_Str=&PubCancel=0&SettleHour=0&FilterType=0&PGType=2&UserID=0&TimeStamp=1565447134&Ver=1.0&AppVer=2.0.0&AppOS=webapp&AppID=webapp&Sign=c611d64305b60702ec3309aacf5cf36f
它们的数据接口主要是通过一个签名参数Sign和时间戳参数TimeStamp进行校验反爬的,我们去找一下网站的JS代码:
继续往下看
这加密还是挺简单的:主要是通过一个SignKey、查询参数还有时间戳进行MD5加密
👇的字符串就是用来得到签名的,构造这样的字符串,进行MD5加密就能得到我们签名了