Java How to get HTML code from a URL, including its generated AJAX code, using Firebug or any Java library

I need to get code from the Internet, which is partly "pure HTML" and partly HTML generated using AJAX, Javascript.

Since the easiest way to get it seems to be using Firebug, I thought it must exist as a way to use Firebug or some kind of plugin in order to be able to do this from Java code.

The problem is that after searching many websites and portals, I did not find anything.

Does anyone know some way / some plugin ... that allows you to get this generated AJAX code mixed with static HTML like Firebug?

Thank you, please excuse my English.

+5
source share
2 answers

Abhijeet is on the right track, but I'm going to take the time to explain how browsers handle web pages and help understand why your request is so difficult.

Warning This is rather rude, and I give in to details a bit for brevity and clarity.

HTTP . , , , . javascript, , , . javascript , , DOM Document Object Model. Javascript DOM, DOM - , . firebug ( webkit) , DOM.

, URL-, , , javascript Java.

. HTMLUnit ( ) - , , Java, . , , API .

+2

- GET/POST. , Firebug , GET/POST.

URLConnection, Java-.

, htmlunit.

+2

All Articles