0

I call a http request to get the html of a url. The same also happens, for example, when doing "view source" in Firefox. As you know, the html is different than the final html of the site as it is seen in the browser itself.

Is there a way to call the http request of a url and "do something" so I will have the final "version" of the html including everything that is there when the site ends to load?

The Firefox was an example, I meant calling a http request with a http client, using Java for example. I call a http request to get the html but the html is the "before" state.

Thanks

Amos
  • 1,321
  • 2
  • 23
  • 44
  • Open debugger, and in the "elements" tab right-click on html tag and select "edit as html" menu item. – oklas Oct 08 '18 at 12:25
  • Your browser's debugging tools should show you the current state of the DOM, after any client-side processing has been done. I don't know if Firefox ever put something built-in or still relies on the Firebug plugin, but that's the direction to take. – David Oct 08 '18 at 12:26
  • In chrome, you can do as @oklas says, or a better way: Open your inspector and navigate to the Network tab. Refresh the page with the inspector open and filter out documents/Doc. You can now see the Http call for the page and inspect its response. – Sølve T. Oct 08 '18 at 12:36
  • I guess I was misunderstood, I updated my question. I meant how can it be done when calling http request to get the html of a url. – Amos Oct 08 '18 at 12:38
  • @Amos: It sounds like what you're looking for is called a "headless browser". I'm not aware of anything built-in to any given programming language which does this, but there are 3rd party components. Basically it mimicks a web browser but without the UI, for the purpose of being used in code. – David Oct 08 '18 at 12:40
  • Thats because the content isnt rendered then, either make the content pre-rendered or server side rendered to get the full html – niclas_4 Oct 08 '18 at 12:41
  • @David , thanks, I will look for something. – Amos Oct 08 '18 at 13:03

0 Answers0