import urllib.request urls = [ "https://soulapi.quwanzhi.com/api/admin/mbti-avatars", "https://soulapi.quwanzhi.com/static/mbti-avatars-png-male/INTJ.png", ] for u in urls: try: with urllib.request.urlopen(u, timeout=12) as resp: print(u, resp.status, resp.headers.get("Content-Type")) except Exception as e: print(u, "ERR", e)