I'm trying to automatically fill a form from the website of my school.
I've seen some ways to do with javascrip.
Here is my code:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.navegador_siiau_layout);
navegador_siiau = (WebView) findViewById(R.id.wv_navegador_siiau);
navegador_siiau.getSettings().setJavaScriptEnabled(true);
navegador_siiau.loadUrl("http://siiauescolar.siiau.udg.mx/wus/gupprincipal.inicio");
navegador_siiau.setWebViewClient(new WebViewClient() {
public void onPageFinished(WebView view, String url) {
String user="207512134";
String pwd="FENMAA";
view.loadUrl("javascript:document.getElementsByName('p_codigo_c').value = '"+user+"';document.getElementsByName('p_clave_c').value='"+pwd+"';");
}
});
}
The result is a blank page with the last string I try to put in the form...
What can I do to fill and submit the form correctly?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…