import urllib.request import ssl # 关闭ssl证书验证(固定写法) ssl._create_default_https_context = ssl._create_unverified_context url = 'https://inv-veri.chinatax.gov.cn/' res = urllib.request.urlopen(url) # 输出状态码 print(res.getcode())