You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
报错如下: 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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: