How can I download the pages referenced by me bookmarks as html files?

Posted on

Problem :

I have lots of bookmarks (guitar chords of songs) , saved in Google Chrome, and also a nice program called XMarks
It works great, but one problem is, some of the old webpages is getting deleted, so I want to save a local copy of them. And I dont want to

for(i=0; i<infinity; i++)
 open page;
 right click;
 save page;

so is there a software or browser extension that allows me to download all the bookmark pages?

(a php script or similar could also work, I just want the files, and I want to be able to do it regularly)
Thanks for any help!

Edit: And I want to preserve the folder structure as the bookmarks folder, too.

Edit 2: : I am not trying to export my bookmarks. I am trying to save every page referenced by my bookmarks (thanks for the edit on the title), so I need a program that opens all my bookmarks, presses Ctrl + S , and saves it (hopefully with the same folder structure as my bookmarks) . see my little code joke above 🙂

Edit 3 : “Thanks for any help!” means I’m not downvoting any answers, since there is the intention of help.

Solution :

Export your bookmark list as HTML, then use wget to download every page linked to, and all of the images and scripts necessary to display those pages:

wget --recursive --level 1 --page-requisites --convert-links --force-html --input-file bookmarks_7_7_14.html

--level 1 limits the recursive downloading to following one link, from your bookmarks page to the bookmarked website.

--page-requisites means to download the files required to display each page (images, styles, javascript, etc).

--convert-links will change the links to relative ones that work locally if the files are downloaded (images etc) and will change the links to absolute ones (links to other pages) if they aren’t.

--force-html will tell wget to treat the input file as an html page rather than a list of URLs.

If you do this repeatedly, some further care will need to be taken to avoid overwriting old downloads with new downloads.

NOTE: This will only download the page you have bookmarked, not other pages on the same site. More complex solutions would be required if you want to mirror some or all of the target sites, and more complex still if you want to be picky about which ones get mirrored how much.

If you want to download some pages of actual site then you will need some tool to copy a website. One free tool that I use frequently is httrack

But if you Google you will probably find number tools that does similar things… some are free some are paid.

Leave a Reply

Your email address will not be published. Required fields are marked *