0

I want to login to this website from an android application i have done everything except getting the captcha image into the app, here is my code tell now:

final String sss = null;

        wv.setWebViewClient(new WebViewClient(){
            @Override
            public void onPageFinished(WebView view, String url) {
                super.onPageFinished(view, url);


                //Get the captcha image here

            }
        });




        wv.setVisibility(View.GONE);




        done.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {


                        wv.loadUrl("javascript:var x = document.getElementById('tbPublic').value = '" + username.getText().toString() + "';");
                        wv.loadUrl("javascript:var x = document.getElementById('tbPrivate').value = '" + password.getText().toString() + "';");
                        wv.loadUrl("javascript:var x = document.getElementById('tbCaptcha').value = '" + code.getText().toString() + "';");
                try {
                    Thread.sleep(2000);
                    wv.loadUrl("javascript:(function(){" +
                            "l=document.getElementById('btnLogin');" +
                            "e=document.createEvent('HTMLEvents');" +
                            "e.initEvent('click',true,true);" +
                            " l.dispatchEvent(e);" +
                            "})()");
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }

i haven't really done much yet but i have been searching for months and i didn't find anything yet, i would really be grateful for any help.

  • Download image from webview and show in image view. Refer this https://stackoverflow.com/q/26379174/7639056 – Kaushik Burkule Sep 28 '19 at 16:34
  • @Kaushik Burkule Thanks,but is there any other way that i can like zoom the webview into the captcha image and show it into the image view? –  Sep 28 '19 at 16:39
  • i suggest download image first and then perform opration like zoom on imageview. – Kaushik Burkule Sep 28 '19 at 16:56

0 Answers0