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)
执行上面代码出现错误:在网上查了很多方法也不管用,求教大神
相关分类