Deepak Prasad
Deepak Prasad

Reputation: 1

Unable to fetch html for the websites loading at client side

I am unable to fetch/render the html for the client-side html loading, I tried using HtmlUnit and Jsoup but both of them are not working. I am only getting a blank html.

try (final WebClient webClient = new WebClient()) {
    webClient.getOptions().setThrowExceptionOnScriptError(false);
    webClient.getOptions().setCssEnabled(false);
    webClient.getOptions().setUseInsecureSSL(true);

    HtmlPage page = webClient.getPage(storeUrl);
    webClient.waitForBackgroundJavaScript(10000);

    System.out.println(page.asXml());
}

I have attached my code above.

<body>
    <div id="app">
    </div>
    <script type="text/javascript" src="https://appgallery5.huawei.com//static/2021092315/js/manifest.7678f8af2ad1888b12b7.js">
    </script>
    <script type="text/javascript" src="https://appgallery5.huawei.com//static/2021092315/js/vendor.4515fcb67725b83423f2.js">
    </script>
    <script type="text/javascript" src="https://appgallery5.huawei.com//static/2021092315/js/app.dffbd1139496dce7c98e.js">
    </script>
  </body>
</html>

Above is the output I am getting. What I am doing wrong here?

Upvotes: 0

Views: 140

Answers (0)

Related Questions