How to save the HTML page generated by JavaScript?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/code-flow.club/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
7 views
There are pages which contain dynamic parts get Ajax or simply some Javascript function (for example, template engines).
So here is how to save the compiled page, i.e. with all the js functions? In the case of Ajax the downloading may occur some time after loading the DOM model.
The solution preferably in JAVA (preferably C#) or via the console Windows/Linux.
For example, you need to download this forexite: calendar for the week.
by | 7 views

7 Answers

0 like 0 dislike
The hacker option is to drive javascript:alert(document.documentElement.innerHTML); in the browser... then Ctrl+A ;)
\r
and for the server there htmlunit.sourceforge.net/
by
0 like 0 dislike
Take a look at this topic, there are several links on the subject.
\rhabrahabr.ru/blogs/webdev/87705/
\r
For Java look this way: download.oracle.com/javase/6/docs/technotes/guides/scripting/programmer_guide/index.html
by
0 like 0 dislike
I have the same issue, but to analyze the results of Google.
If ajax only — you can send additional request and response to generated
html...
\r
PS I assume that the question is not answered, but this topic is also interesting to me and I hope it someone will answer in detail.
by
0 like 0 dislike
To clarify the question: you need the generated html to see or here is a direct you can save it to disk?
\r
If you just look at FF will help, highlight the entire page by using Ctrl+A and then in the context menu, view Selection Source or you can even install WebDeveloper extension, it has a View Generated Source
by
0 like 0 dislike
c#?
put webBrowser on a form that pricees on all handlers download and wait until some time since the last trigger handler download. then pull the innerHTML of the document and save.
\r
truer words were never spoken, now, at hand is no place to experiment. know that nothing is difficult to access DOM through it there, and with keenam processes load also had no problems.
\r
alternatively, if you know exactly the structure of the website which will Rob you can replace the HTML source before rendering. in it paste the link to your JS which overrides one of the original functions call which can be considered a marker for the download to complete. in the overridden functions call the original and then through a window.external call the container method(c#) which will save everything you need.
by
0 like 0 dislike
Firefox → Select all (Ctrl+A) → Right click → Source code selection
by
0 like 0 dislike
by

Related questions

110,608 questions
257,186 answers
0 comments
22,990 users