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