4

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;
 etc;
}

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.

2 Answers 2

6

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.

9
  • and where should i run this command? in the command prompt? Can I turn this into a php code? Because really I need an "automatic" way for this. Since my bookmark list is changing constantly.
    – void
    May 2, 2013 at 15:23
  • yes. wget is available for most OSes, and it's a command line program.
    – Sparr
    May 2, 2013 at 15:24
  • @void you could just do exec('wget ...') in php if you want to keep using wget. you'll probably have to do something to make sure the downloaded files go into a writeable directory, etc.
    – Sparr
    May 2, 2013 at 15:28
  • Instead of using PHP I would recommend creating a Scheduled Task (windows) or cron job (linux, osx) or launchd (osx) that runs the wget command on a schedule.
    – Sparr
    May 2, 2013 at 15:30
  • oh. i didn't read your code. it takes bookmarkfile.html as input. so it is probably what I'm seeking. Thank you very much !
    – void
    May 2, 2013 at 15:30
1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .