- 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中的第一个元素中的第一个字符