为什么我的scrapy ItemLoader失败了?

为什么我的scrapy ItemLoader失败了?,scrapy,Scrapy,我有一个非常简单的蜘蛛网爬行一些。到目前为止,我只对页面顶部的一些元数据感兴趣。 我尝试使用scrapy ItemLoader从页面检索数据。但它不起作用。只有我能得到第一个领域。我错过了什么 ft = FootballTeamItem() sel = Selector(text = response.text) headerLoader = ItemLoader(ft, selector= sel) # headerLoader.add_xpath('name',

我有一个非常简单的蜘蛛网爬行一些。到目前为止,我只对页面顶部的一些元数据感兴趣。 我尝试使用scrapy ItemLoader从页面检索数据。但它不起作用。只有我能得到第一个领域。我错过了什么

ft = FootballTeamItem()
    sel = Selector(text = response.text)
    headerLoader = ItemLoader(ft,  selector= sel)
    # headerLoader.add_xpath('name',  '//h2[@class="team-logo"]/strong/text()')
    headerLoader.add_xpath('league','//div[contains(@class, "intro-con team-con")]/table/tbody/tr[1]/td[1]/a/text()')
    headerLoader.add_xpath('coach', '//div[contains(@class, "intro-con team-con")]/table/tbody/tr[1]/td[2]/text()')
    headerLoader.add_xpath('city',  '//div[contains(@class, "intro-con team-con")]/table/tbody/tr[1]/td[3]/text()')
    headerLoader.add_xpath('start', '//div[contains(@class, "intro-con team-con")]/table/tbody/tr[2]/td[1]/text()')
    headerLoader.add_xpath('court', '//div[contains(@class, "intro-con team-con")]/table/tbody/tr[2]/td[2]/text()')
    headerLoader.load_item()
我尝试了不同的方法来构造ItemLoader,使用选择器实例直接响应或类似的方式。但它仍然不起作用。
有趣的是,代码段运行良好,没有刮擦。但在一个零碎的项目中运行时,它总是失败

在xpath的开头需要一个句点,以将其视为相对于“sel”元素。

您能否共享定义
FootballTeamItem
的代码、spider回调,以及一些显示“在零碎项目中运行时失败”的方式和位置的日志?