scrapy/scrapy — pull request #325 by stav (2013-06-24 18:14:34+00:00)
Title: Add support for iterators in XPathItemLoader

I added iterator support to `XPathItemLoader`, just like in `ItemLoader`.

Now instead of:

kl.add_xpath('brand', '//h1//a/text()')
kl.add_xpath('trail', 'id("CategoryLink")/h2//a/text()')
kl.add_xpath('description', 'id("ItemDesc")/span[@itemprop="description"]/text()')

you can do:

loader.add_xpath(None, dict(
brand='//h1//a/text()',
trail='id("CategoryLink")/h2//a/text()',
description='id("ItemDesc")/span[@itemprop="description"]/text()',
))