This repository was archived by the owner on May 5, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 22# @Author: zhanglei3
33# @Date: 2020-04-08 09:08:13
44# @Last Modified by: leafcoder
5- # @Last Modified time: 2020-04-17 22:51:26
5+ # @Last Modified time: 2020-04-27 21:05:52
66
77"""丁香园数据源"""
88
@@ -34,8 +34,8 @@ def parse(self, response):
3434 datetime .fromtimestamp (statistics ['createTime' ] / 1000.0 ))
3535 modifyTime = make_aware (
3636 datetime .fromtimestamp (statistics ['modifyTime' ] / 1000.0 ))
37- prev_crawler = items .CrawlerItem .django_model .objects .all ().order_by ('-id' )[ 1 ]
38- if prev_crawler .modifyTime == modifyTime :
37+ qs = items .CrawlerItem .django_model .objects .all ().order_by ('-id' )
38+ if qs . count () > 1 and qs [ 1 ] .modifyTime == modifyTime :
3939 logger .info ('Data does not change.' )
4040 self .crawler .delete ()
4141 self .crawler = None
@@ -66,6 +66,7 @@ def parse(self, response):
6666 country .pop ('id' , None )
6767 country ['countryName' ] = country .pop ('provinceName' , None )
6868 country ['provinceName' ] = ''
69+ country .pop ('countryType' )
6970 country .pop ('cityName' )
7071 country .pop ('provinceId' )
7172 country .pop ('provinceName' )
You can’t perform that action at this time.
0 commit comments