Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/280.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 为scrapy准备的小XPath_Python_Scrapy - Fatal编程技术网

Python 为scrapy准备的小XPath

Python 为scrapy准备的小XPath,python,scrapy,Python,Scrapy,通过Chrome,我得到了XPATH /html/body/div[2]/div[2]/section[2]/div/div[2]/div[2]/div[5]/div 扇区 body > div.off-canvas-wrap > div.inner-wrap.brand-padding > section:nth-child(2) > div > div.row.article-view > div.columns.small-12.medium-7 &g

通过Chrome,我得到了XPATH

/html/body/div[2]/div[2]/section[2]/div/div[2]/div[2]/div[5]/div
扇区

body > div.off-canvas-wrap > div.inner-wrap.brand-padding > section:nth-child(2) > div > div.row.article-view > div.columns.small-12.medium-7 > div:nth-child(5) > div
班级是

<div class="columns small-12">

能否为

生成XPATH请尝试:

response.xpath('//div[@class="columns small-12"]').extract()