我认为是xpath默认提取xpath第一个tr属性了,xpath 表达式改成'//div[@class="row"]//table//tr[@height="38px" or @height=""]'
要不尝试一下css selector?
response. css(... ). getall()
或者就用个for循环,在每个xpath的tr后加上[i]
试试这个
t = response.xpath('//table').extract()[0]
import re
print(re.sub(p1,"",t))