Created
September 29, 2018 11:37
-
-
Save rafikahmed/01a138dc4a1e8baea263853008824079 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import scrapy | |
from scrapy.loader.processors import MapCompose, TakeFirst | |
from w3lib.html import remove_tags | |
def remove_whitespace(value): | |
return value.strip() | |
class JokeItem(scrapy.Item): | |
joke_text= scrapy.Field( | |
input_processor= MapCompose(remove_tags, remove_whitespace), | |
output_processor= TakeFirst() | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment