python requests访问网址出错

import requests
from bs4 import BeautifulSoup
import re
user_agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3521.2 Safari/537.36'
headers = {'User-Agent':user_agent}
url = 'http://bxjg.bis.gov.cn//web/s...'

session = requests.session()
session.headers = headers
requests.adapters.DEFAULT_RETRIES = 50
session.keep_alive = False
r = session.get(url)

执行上面代码出现错误:在网上查了很多方法也不管用,求教大神

https://img.mukewang.com/5c1617420001e3f808000164.jpg

临摹微笑
浏览 493回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Html5