Last active
March 13, 2023 15:33
-
-
Save crazygit/7bdd38ed60ff062f0693b94145710576 to your computer and use it in GitHub Desktop.
The difference of scrapy built in loader processor Compose and MapComose
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
from scrapy.loader.processors import Compose, MapCompose | |
proc = Compose(lambda v: v[0], str.upper) | |
proc(['hello', 'world']) # HELLO | |
mproc = MapCompose(lambda v: v[0], str.upper) | |
mproc(['hello', 'world']) # ['H', 'W'] |
good example
Better than in official documentation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This says more than a thousand words.