美文网首页
FakeUserAgentError('Maximum amou

FakeUserAgentError('Maximum amou

作者: 拾柒丶_8257 | 来源:发表于2019-05-22 16:25 被阅读0次
报错:

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

相关文章

网友评论

      本文标题:FakeUserAgentError('Maximum amou

      本文链接:https://www.haomeiwen.com/subject/hhpuzqtx.html