关于Python一直提示IndexError: list index out of range是怎么回事?

)forsiteinsites:item=LoanItem()item['.extract()[0]item['text()".he-pai;])item[... ) for site in sites: item = LoanItem() item['.extract()[0] item['text()".he-pai;]) item['.do" target="_blank">http;tboday/ ] def parse(self;td[2]/://www.cn'] = loan.xpath("amount'rate'td[5]/.cn"] = site; item[' allowed_domains = [".loan import Loan from scrapy;text()".xpath("text()"];tbody/.spider import Spider from scrapy;tr/.xpath("amount']) item['://www;public_time'table/] = loan.xpath(".xpath("text()"tbody/] = site;table/): # -*- coding;company_name'] = site;tr/://www;public_time'... 展开全部> /index.xpath("process'table/text()".scanNumber(item['.items import LoanItem class hepaiSpider(Spider);@style": sel = Selector(response) items = [] loan =Loan() sites = sel;]) items;http;tbody/] = loan;table/period_type'rate'] start_urls = [ "td[6]/, response): utf-8 -*- import time import re from start <收起 问题补充:title'text()"。.extract()[0] exceptions;home/start/: list index out of range 求指教啊;table/spiders/tbody/yx/a/] = site;tr/这是全部的错误提示 File "。;hepai_spider;;);sites//.xpath("scrapy/.IndexError;start/, in parse item['.py", line 26 展开
 我来答
温启勇思
2019-10-18 · TA获得超过3841个赞
知道大有可为答主
回答量:3103
采纳率:29%
帮助的人:239万
展开全部
错误提示是数组调用超出范围了
extract()后边带个【0】是什么意思?代码是自己写的吗?
还有item数组用之前给个定义
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式