Reputation: 2349
I need to return some items from inside a spider before starting to parse requests. Because I need to make sure some parent items exist in database before parsing child items.
I now yield them from the parse
method first thing, and this seem to work fine. But I was wondering if there is a better way to do this?
Upvotes: 0
Views: 103
Reputation: 3847
Instead of yielding the items, write them into the database directly on the constructor of the pipeline where you add regular items to the database.
Upvotes: 1