V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
Ewig
V2EX  ›  Python

Python 中使用 fakeuseragent 报错

  •  
  •   Ewig · 2018-10-10 16:19:49 +08:00 · 2824 次点击
    这是一个创建于 2244 天前的主题,其中的信息可能已经有所发展或是发生改变。
    Error occurred during loading data. Trying to use cache server http://d2g6u4gh6d9rq0.cloudfront.net/browsers/fake_useragent_0.1.10.json
    Traceback (most recent call last):
    File "/usr/lib64/python3.4/urllib/request.py", line 1183, in do_open
    h.request(req.get_method(), req.selector, req.data, headers)
    File "/usr/lib64/python3.4/http/client.py", line 1137, in request
    self._send_request(method, url, body, headers)
    File "/usr/lib64/python3.4/http/client.py", line 1182, in _send_request
    self.endheaders(body)
    File "/usr/lib64/python3.4/http/client.py", line 1133, in endheaders
    self._send_output(message_body)
    File "/usr/lib64/python3.4/http/client.py", line 963, in _send_output
    self.send(msg)
    File "/usr/lib64/python3.4/http/client.py", line 898, in send
    self.connect()
    File "/usr/lib64/python3.4/http/client.py", line 1279, in connect
    super().connect()
    File "/usr/lib64/python3.4/http/client.py", line 871, in connect
    self.timeout, self.source_address)
    File "/usr/lib64/python3.4/socket.py", line 516, in create_connection
    raise err
    File "/usr/lib64/python3.4/socket.py", line 507, in create_connection
    sock.connect(sa)
    socket.timeout: timed out

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "/usr/lib/python3.4/site-packages/fake_useragent/utils.py", line 67, in get
    context=context,
    File "/usr/lib64/python3.4/urllib/request.py", line 161, in urlopen
    return opener.open(url, data, timeout)
    File "/usr/lib64/python3.4/urllib/request.py", line 464, in open
    response = self._open(req, data)
    File "/usr/lib64/python3.4/urllib/request.py", line 482, in _open
    '_open', req)
    File "/usr/lib64/python3.4/urllib/request.py", line 442, in _call_chain
    result = func(*args)
    File "/usr/lib64/python3.4/urllib/request.py", line 1226, in https_open
    context=self._context, check_hostname=self._check_hostname)
    File "/usr/lib64/python3.4/urllib/request.py", line 1185, in do_open
    raise URLError(err)
    urllib.error.URLError: <urlopen error timed out>

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "/usr/lib/python3.4/site-packages/fake_useragent/utils.py", line 154, in load
    for item in get_browsers(verify_ssl=verify_ssl):
    File "/usr/lib/python3.4/site-packages/fake_useragent/utils.py", line 97, in get_browsers
    html = get(settings.BROWSERS_STATS_PAGE, verify_ssl=verify_ssl)
    File "/usr/lib/python3.4/site-packages/fake_useragent/utils.py", line 84, in get
    raise FakeUserAgentError('Maximum amount of retries reached')
    fake_useragent.errors.FakeUserAgentError: Maximum amount of retries reached
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2670 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 09:41 · PVG 17:41 · LAX 01:41 · JFK 04:41
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.