zhihu-python icon indicating copy to clipboard operation
zhihu-python copied to clipboard

爬取用户回答,如果遇到用户某回答被和谐,爬虫自动终止,不能自动跳过

Open v2hey opened this issue 8 years ago • 0 comments

File "run.py", line 7, in answer.to_txt() File "/Users/zhanghe/PycharmProjects/spider/zhihu-python/zhihu.py", line 795, in to_txt content = self.get_content() File "/Users/zhanghe/PycharmProjects/spider/zhihu-python/zhihu.py", line 779, in get_content soup.body.append(answer) File "/Users/zhanghe/PycharmProjects/spider/venv/lib/python2.7/site-packages/bs4/element.py", line 366, in append self.insert(len(self.contents), tag) File "/Users/zhanghe/PycharmProjects/spider/venv/lib/python2.7/site-packages/bs4/element.py", line 300, in insert raise ValueError("Cannot insert None into a tag.") ValueError: Cannot insert None into a tag.

v2hey avatar Apr 17 '16 07:04 v2hey