Windows 10 will reach EOS (end of support) on October 14, 2025. For more information, see this article.

Prohledat stránky podpory

Vyhněte se podvodům. Za účelem poskytnutí podpory vás nikdy nežádáme, abyste zavolali nebo poslali SMS na nějaké telefonní číslo nebo abyste sdělili své osobní údaje. Jakékoliv podezřelé chování nám prosím nahlaste pomocí odkazu „Nahlásit zneužití“.

Zjistit více

How to convert bookmarks.html to workable text of folders, titles and urls?

  • 3 odpovědi
  • 0 má tento problém
  • 24 zobrazení
  • Poslední odpověď od Paul

more options

Hello, any best practices for converting Firefox bookmarks once they're exported? The exported_bookmarks.html are an html file which are impossible to edit. Converting so the data for folders, titles and urls can be edited is what's needed.

I tried Vi with some Regex code, however the cleaned file is not so clean.

Hello, any best practices for converting Firefox bookmarks once they're exported? The exported_bookmarks.html are an html file which are impossible to edit. Converting so the data for folders, titles and urls can be edited is what's needed. I tried Vi with some Regex code, however the cleaned file is not so clean.

Všechny odpovědi (3)

more options

Hi

Have you tried the backup tool? This exports the data as a JSON that you might find easier to work with.

Pomohla vám tato odpověď?

more options

Thanks, tried html and json formats now. AI is giving wrong code and nothing is working. Think I'll work on some other channels for the conversion code, until Firefox has some easier way to edit bookmarks.

Code examples:

$  cat bookmarks_edit.tsv 

jq -r '

 # Recursive walk that carries the folder path as an array
 def walk(path):
   . as $node |
   if $node.type == "folder" then
     ($node.name // "Unnamed") as $fname |
     ($node.children // [])[] | walk(path + [$fname])
   elif $node.type == "bookmark" then
     "\($node.url)\t\($node.title)\t\(path|join(\"/\"))"
   else empty end;
 .folders[] | walk([])

' bookmarks-2025-10-11.json > bookmarks_edit.tsv


HTML to Python: from bs4 import BeautifulSoup

with open('bookmarks.html', 'r', encoding='utf-8') as f:

   soup = BeautifulSoup(f, 'html.parser')

for link in soup.find_all('a'):

   print(f"{link.text} | {link.get('href')}")

JSON to Python import json

with open("bookmarks.json", "r", encoding="utf-8") as f:

   data = json.load(f)

def extract_bookmarks(node):

   if node.get('type') == 'text/x-moz-place':
       print(f"{node.get('title', )} | {node.get('uri', )}")
   for child in node.get('children', []):
       extract_bookmarks(child)

extract_bookmarks(data['roots']['bookmark_bar']) extract_bookmarks(data['roots']['other_bookmarks']) extract_bookmarks(data['roots']['toolbar'])

Pomohla vám tato odpověď?

more options

This is a little out of our remit here. You might want to ask the experts at https://stackoverflow.com/questions for help with this.

Pomohla vám tato odpověď?

Položit dotaz

Pro přidání odpovědi se musíte přihlásit ke svému účtu. Pokud dosud nemáte účet, položte nový dotaz.