Ad

Recovering HTML Rendered In Browser Using JSoup

- 1 answer

Can somebody kindly suggest the proper way to use JSoup on a website like "https://network.axial.net/a/company/business-team-san-francisco/"?

This website has a lot of Javascripting, and no matter what I do {documentObj.body().data(), documentObj.html(), connectionObj.response().body(), Jsoup.connect(urlStr).userAgent("Mozilla").data("name", "jsoup") etc.}, I am not able to recover the html that is rendered in a browser.

Ad

Answer

This is not possible with JSoup. The intent of JSoup is to parse HTML only.

If you are looking for something that can evaluate Javascript to return the resulting DOM, you might want to look at either Selenium or HtmlUnit.

Ad
source: stackoverflow.com
Ad