import urllib.request, re req = urllib.request.Request('https://github.com/SkillNerds/xskill', headers={'User-Agent': 'Mozilla/5.0'}) resp = urllib.request.urlopen(req, timeout=15) html = resp.read().decode('utf-8') # Find description from meta m = re.search(r'([^<]+)', html) if m: print(f"标题: {m.group(1)}") print(f"页面大小: {len(html)} bytes")