FakeUserAgentError('Maximum amount of retries reached') 彻底解决办法


报错:

FakeUserAgentError('Maximum amount of retries reached')

禁用服务器缓存:

ua = UserAgent(use_cache_server=False)
无效
不缓存数据:
ua = UserAgent(cache=False)
无效
忽略ssl验证:
ua = UserAgent(verify_ssl=False)
无效

解决办法:

下载: https://fake-useragent.herokuapp.com/browsers/0.1.11 并另存为:fake_useragent.json
def get_header():
	location = os.getcwd() + '/fake_useragent.json'
	ua = fake_useragent.UserAgent(path=location)
	return ua.random


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM