我正在尝试填写一些字段(工作)然后单击登录按钮(不工作)我尝试过:
document.getElementById('loginButton').click();"
和
document.forms['form'].submit();
按钮名称和表单名称是正确的,我做错了什么?
webview.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url)
{
webview.loadUrl("javascript:(function() { " +
"document.getElementById('coCode').value = 'CompanyCode';" +
"document.getElementById('loginName').value = 'LoginName';" +
"document.getElementById('password').value = 'Password';" +
//"document.forms['form'].submit();" + //Doesn't Work
//"document.getElementById('loginButton').click();" + //Doesn't Work
"})()");
}
});