# -*- coding: utf-8 -*- import json, time, urllib.request import websocket BASE = "http://127.0.0.1:9223" tabs = json.loads(urllib.request.urlopen(BASE + "/json", timeout=5).read()) for t in tabs: print(t.get("type"), "|", t.get("url","")[:80])