Answer the question
In order to leave comments, you need to log in
Is it possible to render an html/js page on the server?
I have a resulting html page with a bunch of java script. Is it possible to render it and get the original html (without js)?
Answer the question
In order to leave comments, you need to log in
If only links and containers are needed (and the original links are static):
1. Get the DOM render of the page using phantom.js
2. Get the current DOM with all object properties after rendering
3. Remove all scripts from there (filter).
4. We extract all the styles of DOM objects from the DOM - we form a new style (CSS) for each of the DOM objects for this page, which we then minimize, inline (to the style tag in the header).
5. Save the finished page as an HTML file.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question