Loading

【爬虫】debug篇-关于fake_useragent无法使用:Error occurred during loading data. Trying to use cache server https://fake-useragent.herokuapp.com/browsers/0.1.11

Error occurred during loading data. Trying to use cache server https://fake-useragent.herokuapp.com/browsers/0.1.11
Traceback (most recent call last):
  File "D:\python\lib\site-packages\fake_useragent\utils.py", line 154, in load
    for item in get_browsers(verify_ssl=verify_ssl):
  File "D:\python\lib\site-packages\fake_useragent\utils.py", line 99, in get_browsers
    html = html.split('<table class="w3-table-all notranslate">')[1]
IndexError: list index out of range

Process finished with exit code 1

引入path参数,指定本地文件的位置

UserAgent(path=r'./fake_useragent.json').Chrome
posted @ 2024-04-05 21:56  踩坑大王  阅读(143)  评论(0)    收藏  举报