From: stand4love <sta...@16...> - 2015-03-06 08:36:55
|
Let me provide a bit more info: The login page (https://auth.alipay.com/login/index.htm) needs to be accessed using mobile user-agent: Mozilla/5.0 (iPad; U; CPU OS 4_3_5 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8L1 Safari/6533.18.5 Then the page will show username and password inputs (rather than activex control). Then I fill the username, password, and the verification code, and submit the form: HtmlTextInput nameInput = (HtmlTextInput) loginPage.querySelector("#J-input-user"); nameInput.focus(); nameInput.setValueAttribute(username); nameInput.blur(); HtmlPasswordInput pwdInput = (HtmlPasswordInput) loginPage.querySelector("#password_input"); pwdInput.focus(); pwdInput.setValueAttribute(password); pwdInput.blur(); // enter verify-code HtmlTextInput verifyCodeInput = (HtmlTextInput) loginPage.querySelector("#J-input-checkcode"); verifyCodeInput.focus(); verifyCodeInput.type(verifyCode); verifyCodeInput.blur(); HtmlSubmitInput buttonInput = (HtmlSubmitInput) loginPage.querySelector("#J-login-btn"); webClient.waitForBackgroundJavaScript(10000); HtmlPage mainPage = buttonInput.click(); webClient.waitForBackgroundJavaScript(10000); Then that error occurs. (Note that due to the chinese character issues, now all the js files are loaded from local file system, I created a custom WebConnectionWrapper to intercept the js requests). 2015-03-06 stand4love |