Python 如何处理scrapy Itemloader()

Python 如何处理scrapy Itemloader(),python,scrapy,Python,Scrapy,如何表达这一点 item[field_name]=response.xpath('//*[@calss="title name "]/a/span').xpath('string(.)') 这件事 l=ItemLoader(item=ConccreseItem(),response=response) l.add_xpath('field_name','//*[@class="title name"]/a/span') 如何将.string('.')添加到第二个表达式中?第一个xpath()

如何表达这一点

item[field_name]=response.xpath('//*[@calss="title name "]/a/span').xpath('string(.)')
这件事

l=ItemLoader(item=ConccreseItem(),response=response)
l.add_xpath('field_name','//*[@class="title name"]/a/span')

如何将.string('.')添加到第二个表达式中?

第一个xpath()调用是否需要1个或多个值?如果只需要1,您可以使用
response.xpath(/string(/some/location/path)
我需要2个值,我还想将参数传递给xpath(),只使用一个xpath()来修复第一行。如何将其置于首位?我自己不是itemloader用户,但您可以尝试
。添加值(字段名称,response.xpath('/*[@calss=“title name”]/a/span').xpath('string(.))
@paultrmbrth谢谢,我一直这么想,但我怀疑它的类型,现在你可以帮我了!谢谢你