Skip to content

Commit

Permalink
Merge pull request #5 from SecondDim/hotfix/fix
Browse files Browse the repository at this point in the history
Hotfix/fix bug
  • Loading branch information
SecondDim authored Feb 2, 2020
2 parents 7af43c2 + 0b40808 commit e91c372
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crawler_news/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
# Configure item pipelines
# See https://docs.scrapy.org/en/latest/topics/item-pipeline.html
ITEM_PIPELINES = {
'crawler_news.pipelines.CassandraPipeline': 300,
'crawler_news.pipelines.CassandraPipeline': 300,
}

# Enable and configure the AutoThrottle extension (disabled by default)
Expand Down
6 changes: 3 additions & 3 deletions crawler_news/spiders/LibertyTimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ def _parse_publish_date(self, response):

def _parse_authors(self, response):
if re.match('https://sports', response.url):
return [response.css('article *::text').re_first(r'記者.*報導',defult='')]
return [response.css('article *::text').re_first(r'記者.*報導',default='')]
elif re.match('https://partners', response.url):
return [response.css('article span::text').re_first(r'[0-9-]+ [0-9:]+',defult='')]
return [response.css('article span::text').re_first(r'[0-9-]+ [0-9:]+',default='')]
else:
return [response.css('div.text>p *::text').re_first(r'記者.*報導',defult='')]
return [response.css('div.text>p *::text').re_first(r'記者.*報導',default='')]

def _parse_tags(self, response):
# no tags
Expand Down
2 changes: 1 addition & 1 deletion crawler_news/spiders/ettoday.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def _parse_publish_date(self, response):
return response.css('time.date::text').get().strip()

def _parse_authors(self, response):
return [response.css('div.story>p *::text').re_first(r'記者.*報導', defult='')]
return [response.css('div.story>p *::text').re_first(r'記者.*報導', default='')]

def _parse_tags(self, response):
news_tags = []
Expand Down

0 comments on commit e91c372

Please sign in to comment.