import java.io.IOException;
import okhttp3.FormBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
public class App
{
static String username="李日晟";
OkHttpClient client = new OkHttpClient();
public static void main( String[] args )
{
String url = "https://448282.yichafen.com/public/queryscore/sqcode/OsDcQn0mNjMxfGYyYzc2ZTc0YjFhNDQ4NjQ2OTZhN2E4ZjQzZDA5ZjkyfDQ0ODI4MgO0O0OO0O0O.html";
try {
for (int i = 200101; i <= 202550; i++) {
String str = new App().post(url,String.valueOf(i));
if (str.indexOf("考號 姓名不正確")>-1) {
System.out.println(i);
}else{
System.out.println(str);
return;
}
}
} catch (Exception e) {
System.out.println(e);
}
}
String post(String url, String kaohao) throws IOException {
FormBody formBody = new FormBody.Builder()
.add("s_kaohao", String.valueOf(kaohao))
.add("s_xingming",username)
.build();
Request request = new Request.Builder()
.url(url)
.post(formBody)
.build();
try (Response response = client.newCall(request).execute()) {
return response.body().string();
}
}
}
uj5u.com熱心網友回復:
什么是無法跑碼,我復制運行了,回傳的結果是一個頁面轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/22618.html
標籤:Web 開發
