Fetch bookmarks from Browser using Python

Tags: Python, json, bookmark, browser, firefox, tags

bookmark_json.py gist


So, after making a python script for fetching bookmarks from the exported HTML files, I was wondering how to make it work automatically so that I don’t need to give the HTML file every time. I started looking in firefox directory for some bookmark files which I could use. I found out that firefox keeps bookmark backups and they are encoded in json. I learned few things about json and started to write the script.
Importing Modules

import json
import os

Locate the directory in which the browser stores the bookmarks backup. Continue reading


Fetch bookmarks from browser(html version) using Python

Tags : Python, BeautifulSoup, bookmark, browser, html

bookmark.py gist

Priyans Murarka was having troubles managing his bookmarks. He wanted to keep all the bookmarks from all the browsers from all the OSes in one place. So, I suggested him to use rowz . It’s a really good website to keep your bookmarks at one place and also you can view others’ bookmarks also. Recently, they added a new feature, using which one could import the bookmarks from the browser. What they do is they ask you to export your bookmarks in an HTML file and upload it on the site. So, I see an HTML file, and all I can think of is BeautifulSoup. So, I open the HTML file. And.. OK! it’s damn easy!
Importing Modules

from BeautifulSoup import BeautifulSoup
import time

Continue reading