Python CLI to edit Firefox bookmarks?

十年热恋 提交于 2019-12-03 21:51:58

Assuming we're talking about Firefox 3 or better, the bookmarks are kept in a SQLite file, places.sqlite in the profile folder. So you need a routine to find the profile folder (depending on your platform) and then you can load the SQLite file.

The schema's rich and a bit complicated, but well documented, and of course with Python's SQLite support you can explore it interactively.

Of course, Firefox keeps the DB locked when it's running. For read-only access, you can just copy places.sqlite into a temporary file, then open and explore that one; to perform changes as you seem to require, however, it seems best to require the user to quit Firefox (if that's unacceptable, you could explore if Firefox offers a way to ask for its cooperation).

Is this the kind of things you had in mind...?

I don't know about all the features you've mentioned but "Organize bookmars" option in the Bookmarks menu is pretty decent with respect to features.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!