title = response.xpath("//div[@class='entry-header']/h1/text()")
title = response.xpath("//div[@class='entry-header']/h1/text()").extract()
title = response.xpath("//div[@class='entry-header']/h1/text()").extract()[0]
title = response.xpath("//div[@class='entry-header']/h1/text()")[0].extract()
title = response.xpath("//div[@class='entry-header']/h1/text()")[0].extract()[0]
返回一個SelectorList對象 http://scrapy-chs.readthedocs.io/zh_CN/0.24/topics/selectors.html#selectorlist
返回一個list
返回list中的第一個元素
返回SelectorList中的第一個元素(如果list為空拋出異常),返回的是一str類型,與3效果相同
返回SelectorList中的第一個元素中的第一個字符