安装
pip install fake-useragent -i https://pypi.douban.com/simple
报错重大问题
在远程服务器运行报错 Maxinun amount of retries reached 重试次数达到最大值
原因加载不了 远程的 文件fake_useragent 文件
解决办法
在程序打包后, 读取外部的 fake_useragent .json 文件即可
from fake_useragent import UserAgentif __name__ == '__main__':location = os.getcwd() + '\\fake_useragent.json'print("location", location)ua = UserAgent(path=location)--------------------------------------------"""打印location E:\008Python01\pycrawler\day05_2.0\fake_useragent.json"""

