Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

165
Views
Android - Parsing website from webview with jsoup
private final Handler uiHandler = new Handler();
private class JSHtmlInterface {
    @android.webkit.JavascriptInterface
    public void showHTML(String html) {
        final String htmlContent = html;
        uiHandler.post(
            new Runnable() {
                @Override
                public void run() {
                    Document doc = Jsoup.parse(htmlContent);
                    Elements elements = doc.select("div[class='jsx-2839133444 main user-page']");
                    Log.e("asdasd", String.valueOf(elements));

                }
            }
        );
    }
}

try {
    browser.addJavascriptInterface(new JSHtmlInterface(), "JSBridge");
    browser.setWebViewClient(
        new WebViewClient() {
            @Override
            public void onPageStarted(WebView view, String url, Bitmap favicon) {
                progressDialog.show();
                super.onPageStarted(view, url, favicon);
            }

            @Override
            public void onPageFinished(WebView view, String url) {
                browser.loadUrl("javascript:window.JSBridge.showHTML('<html>'+document.getElementsByTagName('html')[0].innerHTML+'</html>');");
                progressDialog.dismiss();
            }
        }
    );
    browser.loadUrl("https://tiktok.com/@ronaldo");
} catch (Exception e) {
    e.printStackTrace();
}

enter image description here Hello everyone, I'm trying to parse the url using JSOUP with webview, but the required data is coming as - as in the picture. How can I solve it?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!