问题遇到的现象和发生背景
遇到的现象和发生背景,请写出第一个错误信息
import scrapy
class ItcastSpider(scrapy.Spider):
name = "itcast"
allowed_domains = ["itcast.cn/"]
start_urls = ["https://python.itheima.com/?pythonzly#navjxtd"]
def parse(self, response):
# with open("itcast.html", "wb")as f:
# f.write(response.body)
node_list = response.xpath('//div[@class="li_txt"]')
print(node_list)
for node in node_list:
temp = {}
temp['name'] = node.xpath('./h3/text()').extract()
temp['experience'] = node.xpath('./p/text()').extract()
yield temp
print(response.status)
我觉得我的xpath路径正确的
用代码块功能插入代码,请勿粘贴截图。 不用代码块回答率下降 50%
请求帮助