想爬取数据“2868.46和-0.07%”时报了这个错误是什么问题呢?爬文本的时候是正常的,
要爬取的网页代码:
写的爬虫语言,
news_text2 = selector.xpath('//html/body/div[5]/div[4]/a[1]/span/text()')[0]
print(news_text)
报的错误
Traceback (most recent call last):
File "L:/PycharmProjects/untitled/newstest/test.py", line 11, in
news_text2 = selector.xpath('//html/body/div[5]/div[4]/a[1]/span/text()')[0]
IndexError: list index out of range