解决python爬虫问题:urllib.error.HTTPError: HTTP Error 301: The HTTP server returned a redirect error that would lead to an infinite loop.
报错的原始方法: 1)使用request.Request,出现上述错误。html无法爬取 from urllib import request def get_html(self, url): print(url) req = request.Request(url=url, headers={'U