我想知道是否在Java代码中选择了单选框loginTypeI
和loginTypeS
?
我的代码:
Connection.Response loginPageResponse = Jsoup.connect(UNIV_URL)
.method(Connection.Method.GET)
.execute();
Map<String, String> loginTryCookie = loginPageResponse.cookies();
System.out.println("loginTryCookie" + loginTryCookie);
Document loginPageDocument = loginPageResponse.parse();
String loginTypeI = loginPageDocument.select("input[id=loginTypeI]").val();
String loginTypeS = loginPageDocument.select("input[id=loginTypeS]").val();
String loginType = loginPageDocument.select("input[id=loginTypeI]").val();
Map<String, String> data = new HashMap<String, String>();
data.put("userId", userId);
data.put("userPwd", userPwd);
data.put("loginTypeI", "true");
data.put("loginTypeS", "false");
data.put("loginType", loginType);
System.out.println("Data : " + data);
Connection.Response response = Jsoup.connect(Login_URL)
.cookies(loginTryCookie)
.data(data)
.method(Connection.Method.POST)
.execute();
Map<String, String> loginCookie = response.cookies();
System.out.println("loginCookie : " + loginCookie);