scrapy选择器

xpath:

在这里插入图片描述

    def parse(self, response):
        data_list = response.xpath("//div[@id='list']/table/tbody").xpath(".//tr")
        for data in data_list:
            content = data.xpath('.//td/text()').extract()
            print(content)

相对定位和绝对定位
节点定位
使用@属性定位
多条件选择定位
使用函数
xpath轴
这个不需要宣布记住,每次用到过来看看就ok了!

猜你喜欢

转载自blog.csdn.net/m0_47265814/article/details/106069228