Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

列表中存在已被豆瓣移除条目会导致错误,无法读取 #9

Open
qilinz opened this issue Oct 21, 2021 · 0 comments
Open

Comments

@qilinz
Copy link

qilinz commented Oct 21, 2021

Hi! 感谢脚本,很方便。
遇到一个问题就是,如果列表中存在已被移除的条目会发生错误,导致程序无法运行。

手动解决办法就是在豆瓣上删除不存在的条目。

报错如下:
Traceback (most recent call last): File "personalCrawler.py", line 8, in <module> bookv2.main() File "/Users/xxx/Documents/douban_crawler-master/code/bookv2.py", line 260, in main clawer.main() File "/Users/xxx/Documents/douban_crawler-master/code/bookv2.py", line 239, in main self.Saw() File "/Users/xxx/Documents/douban_crawler-master/code/bookv2.py", line 183, in Saw if (self.saw_store(soup.find_all(class_='item'),lastBid) == -1): File "/Users/xxx/Documents/douban_crawler-master/code/bookv2.py", line 139, in saw_store date,star,comment,owntag,name,bid=self.saw_get(item) File "/Users/xxx/Documents/douban_crawler-master/code/bookv2.py", line 147, in saw_get date=saw(class_=re.compile('date'))[0].get_text(strip=True) IndexError: list index out of range

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant