Z
Z
zencd2011-02-11 14:37:39
Browsers
zencd, 2011-02-11 14:37:39

How to save a static snippet of the DOM of an HTML page?

I need to save the page opened in the browser (Firefox/Chrome), but to do it not as browsers do, but so that the page looks exactly the same when the snapshot is opened as it was before saving.

Scripts, thus:
- should work until the moment of saving,
- should not be saved ,
- the result of their work should be saved.

According to HTTP, no one should break outside either.

Nugget Format: HTML/CSS/images.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
E
Eugene, 2011-02-11
@immaculate

ScrapBook based firefox extension? If ScrapBook itself doesn't fit.
I once wrote a similar extension (there were peculiar additional requirements for saving pages), referring to the ScrapBook code, it really takes several days to work there, if you just take the ScrapBook sources and file it, then you can meet the day.

S
sajgak, 2011-02-11
@sajgak

write a kind of macro that will open the site with firebug, save the content of the html tab from it and load its dependencies (images, css, js). In theory, all functionality will be preserved + you have the state of the page at the right time. Implementation shouldn't be that hard either.

M
Mikhail Davydov, 2011-02-11
@azproduction

Option without extensions:
All page content with path replacement, perform the function on the desired page.


(function getCurrentSource() {
var doctype = document.body.parentNode.previousSibling,
    content = '<!DOCTYPE' + (doctype.name ? ' ' + doctype.name : doctype.name) + (doctype.publicId ? ' ' + doctype.publicId : doctype.publicId) + '>\n' + document.body.parentNode.innerHTML,
    base = window.location.href.replace(window.location.hash, '');

return content.replace(/<script\b[^>]*>(.*?)<\/script>/i, '')
.replace(new RegExp('((?:src|href)=[\"\']?)' + base, 'g'), '$1')
}());

Other resources:
wget -c -t0 -p -E -k www.google.com/

A
Anatoly, 2011-02-15
@taliban

Maybe this is just what you need:
Piccy.info - Free Image Hosting

V
Vitaly Peretyatko, 2011-02-15
@viperet

It looks like the www.peeep.us bookmarklet does what you want

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question