Created
September 10, 2019 19:32
-
-
Save harrywang/8e59b5a961aca8d44e182d8dc9fb8bd0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scrapy.item import Item, Field | |
from scrapy.loader.processors import MapCompose | |
def remove_quotes(text): | |
# strip the unicode quotes | |
text = text.strip(u'\u201c'u'\u201d') | |
return text | |
class QuoteItem(Item): | |
quote_content = Field( | |
input_processor=MapCompose(remove_quotes) | |
) | |
tags = Field() | |
author_name = Field() | |
author_birthday = Field() | |
author_bornlocation = Field() | |
author_bio = Field() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment