http://geeklad.com/updated-script-to-download-google-history
However, this code is somehow executed on the developers server, so there're some privacy issues here (god knows whether your history is being saved there). So I set out to code a ruby script to download my web history.
https://github.com/terhechte/Google-Web-History-Downloader
This works only for around 4k of entries though. It would be more work in order to support downloading the entire history, for that either fork the script or use the script mentioned above
I used the geeklad script above instead of my Ruby script, but I figured I'd share my ruby approach nontheless so somebody can improve on it.
Cheers.