Skip to content

Instantly share code, notes, and snippets.

@paitonic
Created March 12, 2011 15:54
Show Gist options
  • Save paitonic/867328 to your computer and use it in GitHub Desktop.
Save paitonic/867328 to your computer and use it in GitHub Desktop.
parses chrome+firefox bookmarks
from BeautifulSoup import BeautifulSoup
f = open("chrome-fav.html","r")
html = f.read()
f.close()
soup = BeautifulSoup(html)
bookmarks = soup.findAll('a')
# attributes: href, add_date, icon etc.
# each['ATTRIBUTE']
for each in bookmarks:
title = each.string
url = each['href']
print "Title: " + title
print "Url: " + url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment