python_scripts icon indicating copy to clipboard operation
python_scripts copied to clipboard

list index out of range

Open yingxincui opened this issue 7 years ago • 2 comments

python3 crawler.py Traceback (most recent call last): File "crawler.py", line 163, in crawler.run() File "crawler.py", line 90, in run for index, url in enumerate(self.parse_menu(self.request(self.start_url))): File "crawler.py", line 116, in parse_menu menu_tag = soup.find_all(class_="uk-nav uk-nav-side")[1] IndexError: list index out of range

yingxincui avatar Jan 20 '18 02:01 yingxincui

我也遇到了同样的问题,请问你解决了吗?

EricDuy avatar Apr 20 '18 07:04 EricDuy

添加headers,修改user-agent

zys864 avatar Jan 19 '19 07:01 zys864