From f71175a449e2b66c54f17c1d982da5376ef96900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gra=C3=B1a?= Date: Sun, 12 Apr 2015 21:56:23 -0300 Subject: [PATCH] More replaces of references to old `sel` shortcut --- docs/topics/selectors.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/topics/selectors.rst b/docs/topics/selectors.rst index 33958cee5..a84ac9c99 100644 --- a/docs/topics/selectors.rst +++ b/docs/topics/selectors.rst @@ -141,12 +141,12 @@ method, as follows:: If you want to extract only first matched element, you can call the selector ``.extract_first()`` - >>> sel.xpath('//div[@id="images"]/a/text()').extract_first() + >>> response.xpath('//div[@id="images"]/a/text()').extract_first() u'Name: My image 1 ' It returns ``None`` if no element was found: - >>> sel.xpath('//div/[id="not-exists"]/text()').extract_first() is None + >>> response.xpath('//div/[id="not-exists"]/text()').extract_first() is None True Notice that CSS selectors can select text or attribute nodes using CSS3 @@ -383,7 +383,7 @@ with groups of itemscopes and corresponding itemprops:: ... ... ... ... """ - >>> + >>> sel = Selector(text=doc, type="html") >>> for scope in sel.xpath('//div[@itemscope]'): ... print "current scope:", scope.xpath('@itemtype').extract() ... props = scope.xpath('''