python_crawler icon indicating copy to clipboard operation
python_crawler copied to clipboard

爬虫主程序那里运行时出错

Open HideLakitu opened this issue 6 years ago • 2 comments

get_page那里,终端提示 self.pages = int(pages_search.findall(raw_result)[0]) IndexError: list index out of range 请问该怎么解决呢?

HideLakitu avatar Dec 07 '19 07:12 HideLakitu

原因在于首页没有顺利抓下来。 有两种可能,1是网络不流畅,导致抓取失败。2是网页缓存出问题。 建议,多试几次,或者 项目缓存清掉,重新启动。

Albert-W avatar Dec 07 '19 10:12 Albert-W

如何你修改了config中的主页,需要检查一下 正则表示式能不能抓取 page项。

Albert-W avatar Dec 07 '19 10:12 Albert-W