-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow None values in Itemloaders/Items #40
Comments
Hey, this has been a discussion in the past, as I recall. See scrapy/scrapy#556 Beware, this is old code I have yet to update. All you'll really want is just to remove the following line in the current codebase: itemloaders/itemloaders/__init__.py Line 264 in 951e9ed
Or we could try to overturn the old decision, now that some water has passed under the bridge (evil laugh). |
Indeed, I'm in favor of having a flag or specialized |
I don't even know why that wasn't a consideration then. |
Any updates according to it? |
I'm struggling with the same ! any updates??? |
Summary
I would like to pass
None
values to the Itemloader() and store them in an Item(). Right now, None values are discarded and therefore working with Item() does not work properly.Motivation
Sometimes values are not available on every parsed page and when the
Selector
returnsNone
, the database pipeline (Postgres) results in anKeyError: 'fieldname'
.I solved this problem by filling in a
null
String which is later changed toNone
but this seems like a hacky solution.The text was updated successfully, but these errors were encountered: