We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
launcher_new.py使用了fake-useragent可能会出现报错: fake_useragent.errors.FakeUserAgentError: Maximum amount of retries reached
本人尝试了如下解决方案:
先: pip3 install --upgrade fake_useragent
1.修改代码launcher_new.py第十一行 ua = UserAgent(use_cache_server=False,verify_ssl=False,cache=False)
2.利用临时文件 下载https://fake-useragent.herokuapp.com/browsers/0.1.11 //好像国内无法访问 改名为fake_useragent_0.1.11.json 放入临时文件夹(如/tmp)
import tempfile tempfile.gettempdir()
都无法解决
查看代码site-packages/fake_useragent/settings.py 发现要请求BROWSERS_STATS_PAGE = 'https://www.w3schools.com/browsers/default.asp' 但是该url好像国内无法访问所以报该错误
所以建议使用国外vps,或者弃用fake-useragent库。
The text was updated successfully, but these errors were encountered:
选用第二种方法,将 https://fake-useragent.herokuapp.com/browsers/0.1.11 下载的文件与launcher_new.py放入同一目录,然后修改代码launcher_new.py第十一行 为 ua = UserAgent(path="fake_useragent.json") 修改为自己的下载的文件名即可
ua = UserAgent(path="fake_useragent.json")
Sorry, something went wrong.
感谢
No branches or pull requests
launcher_new.py使用了fake-useragent可能会出现报错:
fake_useragent.errors.FakeUserAgentError: Maximum amount of retries reached
本人尝试了如下解决方案:
先:
pip3 install --upgrade fake_useragent
1.修改代码launcher_new.py第十一行
ua = UserAgent(use_cache_server=False,verify_ssl=False,cache=False)
2.利用临时文件
下载https://fake-useragent.herokuapp.com/browsers/0.1.11 //好像国内无法访问
改名为fake_useragent_0.1.11.json
放入临时文件夹(如/tmp)
都无法解决
查看代码site-packages/fake_useragent/settings.py
发现要请求BROWSERS_STATS_PAGE = 'https://www.w3schools.com/browsers/default.asp'
但是该url好像国内无法访问所以报该错误
所以建议使用国外vps,或者弃用fake-useragent库。
The text was updated successfully, but these errors were encountered: