Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Chapter05_Scrapy/wikiSpider/wikiSpider/pipelines.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@ class WikispiderPipeline(object):
def process_item(self, article, spider):
article['lastUpdated'] = article['lastUpdated'].replace('This page was last edited on', '')
article['lastUpdated'] = article['lastUpdated'].strip()
article['lastUpdated'] = datetime.strptime(article['lastUpdated'], '%d %B %Y, at %H:%M.')
article['lastUpdated'] = datetime.strptime(article['lastUpdated'], '%d %B %Y, at %H:%M')
article['text'] = [line for line in article['text'] if line not in whitespace]
article['text'] = ''.join(article['text'])
return article