scrapy/scrapy — pull request #378 by nyov (2013-09-02 21:18:14+00:00)
Title: Support XPathItemLoader selector reassignment

A major useability problem I have with the XPathItemLoader is that I cannot yield it to subsequent pages via Request.meta because the selector is readonly and can't be reassigned on the subsequent page.

Yielding the item with loader.load_item() and instancing a new loader with this item seems sufficient in a few cases but not always, as adding values to an already 'filled' Item field will then get overwritten instead of appended to (which is good enough, again, in some cases).

The included patch seems to work for me for keeping the loader around in Request.meta and then reassigning the selector, but I would love some feedback if this is indeed a viable approach.