2026年6月edge浏览器更新后集锦如何一键导入收藏夹

2026年6月edge浏览器更新后集锦如何一键导入收藏夹

如果还没有重装/卸载浏览器,那么可能数据还在本地,可以用下面的python脚本导出单个html文件,然后使用edge的导入html文件的功能将分组作为文件夹导入浏览器里,实测是可行的:

import sqlite3

import json

import os

import shutil

# Edge 默认配置文件的集锦数据库路径 (如使用其他配置,将 Default 替换为 Profile 1 等)

DB_PATH = os.path.expandvars(r"%LocalAppData%\Microsoft\Edge\User Data\Default\Collections\collectionsSQLite")

TEMP_DB_PATH = "collectionsSQLite_temp.db"

OUTPUT_HTML = "Edge_Collections_Bookmarks.html"

def export_to_html():

if not os.path.exists(DB_PATH):

print(f"[!] 错误: 未找到数据库文件 -> {DB_PATH}")

print("请检查路径。如果存在多个浏览器配置文件,可能位于 Profile 1 或 Profile 2 文件夹下。")

return

# 复制到当前目录,避免 Edge 进程占用导致数据库被锁定

try:

shutil.copy2(DB_PATH, TEMP_DB_PATH)

except IOError as e:

print(f"[!] 复制数据库文件失败: {e}")

return

con = sqlite3.connect(TEMP_DB_PATH)

cur = con.cursor()

# 关联 collections 和 items 表

query = """

SELECT c.title as folder, i.title as title, i.source as data

FROM collections as c, items as i, collections_items_relationship as r

WHERE r.item_id == i.id and r.parent_id == c.id

"""

try:

cur.execute(query)

rows = cur.fetchall()

except sqlite3.Error as e:

print(f"[!] 数据库读取错误: {e}")

return

finally:

con.close()

if os.path.exists(TEMP_DB_PATH):

os.remove(TEMP_DB_PATH)

collections = {}

for folder_name, title, data_blob in rows:

try:

# 数据储存于包含页面元数据的 JSON BLOB 中

data_json = json.loads(data_blob.decode('utf8'))

url = data_json.get("url", "")

if url:

if folder_name not in collections:

collections[folder_name] = []

collections[folder_name].append({"title": title, "url": url})

except Exception:

continue

# 构建 Netscape 标准书签 HTML 结构

html_lines = [

"",

"",

"Bookmarks",

"

Edge Collections Export

",

"

"

]

for folder, items in collections.items():

html_lines.append(f"

{folder}

")

html_lines.append("

")

for item in items:

item_title = item['title'].replace("&", "&").replace("<", "<").replace(">", ">")

html_lines.append(f"

{item_title}")

html_lines.append("

")

html_lines.append("

")

with open(OUTPUT_HTML, "w", encoding="utf-8") as f:

f.write("\n".join(html_lines))

print(f"[*] 导出成功!文件已生成在当前目录: {OUTPUT_HTML}")

print("[*] 该 HTML 文件可直接导入到主流浏览器的书签/收藏夹中。")

if __name__ == "__main__":

export_to_html()

相关手记

bet体育365官网安全吗 8款高效学英语游戏

8款高效学英语游戏

07-10 👁️ 1566
bet体育365官网安全吗 如何取消延时摄影功能

如何取消延时摄影功能

09-05 👁️ 1447
365提款一直在审核 狂追中国电视剧的外国人,他们都在看些什么?(组图)
365提款一直在审核 致命和狂暴伤害的研究及选择建议
365提款一直在审核 广告创意策略有哪些类型?常见策略类型和应用
365bet手机在线 电脑坏了去哪里修比较好怎么维修