scrapy框架 response.xpath返回r为什么为空列表?
scrapy吧
全部回复
仅看楼主
level 1
import scrapy
class FirstSpider(scrapy.Spider):
name = 'first'
# allowed_domains = ['careers.tencent.com']
start_urls = ['https://careers.tencent.com/search.html?pcid=40001']
def parse(self, response):
r = response.xpath('//div[@class="correlation-degree"]/div').extract()
print(r)
2021年08月25日 10点08分 1
level 1
有哪位大神指教哈!
2021年08月25日 10点08分 2
level 1
可以一起自学python,自学qq群:962991806
2021年10月02日 22点10分 3
level 2
可能是动态数据
2021年11月13日 13点11分 4
用 extract()【0】 符号都是英文 或者用extract_first()
2021年11月17日 12点11分
level 2
右键看源代码里是否有标签先 有的话就是定位错误,没有的话要看是哪一种数据返回形式
2021年12月26日 10点12分 5
1