疫情大背景下,各地都是買個口罩都費勁;而且還是秒搶光,怎麼辦?
以下代碼只爲搶口罩更快捷,請勿用於非法用途。造成法律問題,請自行了斷;
第一步,打開預約鏈接 按F12 打開調試界面
第二布,將該段代碼複製到 console 下的 空白處
當前代碼根據青島口罩預約,如需要請自己修改自己所在地預約網址
var code = ""; //如果搶口罩需要輸入驗證碼,請把頁面上的驗證碼寫到這兒
var url = "http://kzyynew.qingdao.gov.cn:81/kz/addYdorder?capval=" + code;
function toAppoint(){
if(code === ""){
console.log("請輸入驗證碼");
}else{
var httpRequest = new XMLHttpRequest();
httpRequest.open('POST' ,url , true);
httpRequest.setRequestHeader("Content-type","application/json");
var obj = {"address":"","name":"","mobile":"","code":"","area":"市北區","street":"","capval":"","ordertype":1};//本段JSON爲預約必須字段
obj.address = '卓越中心1號樓1901';
obj.name = "劉傑";
obj.mobile = "176xxxx6541";
obj.code = "37092319930111xxxx";
obj.area = "市北區";
obj.street = "敦化路街道辦事處";
obj.capval = code;
obj.ordertype = 1;//1是郵政2是順豐
httpRequest.send(JSON.stringify(obj));
httpRequest.onreadystatechange = function () {
if (httpRequest.readyState == 4 && httpRequest.status == 200) {
var json = httpRequest.responseText;//獲取到服務端返回的數據
console.log(json);
}else {
console.log("預約失敗:"+ httpRequest.status);
}
};
}
}
toAppoint();
如下圖所示