From bcb31988f2acecfc5fefa7be0c3a44a7b31e1d77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gra=C3=B1a?= Date: Wed, 9 Nov 2011 09:50:59 -0200 Subject: [PATCH] change tutorial to follow changes on dmoz site --- docs/intro/tutorial.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/intro/tutorial.rst b/docs/intro/tutorial.rst index 840515763..c395dbfa0 100644 --- a/docs/intro/tutorial.rst +++ b/docs/intro/tutorial.rst @@ -268,19 +268,19 @@ The shell also instantiates two selectors, one for HTML (in the ``hxs`` variable) and one for XML (in the ``xxs`` variable) with this response. So let's try them:: - In [1]: hxs.select('/html/head/title') - Out[1]: [] + In [1]: hxs.select('//title') + Out[1]: [] - In [2]: hxs.select('/html/head/title').extract() + In [2]: hxs.select('//title').extract() Out[2]: [u'Open Directory - Computers: Programming: Languages: Python: Books'] - In [3]: hxs.select('/html/head/title/text()') - Out[3]: [] + In [3]: hxs.select('//title/text()') + Out[3]: [] - In [4]: hxs.select('/html/head/title/text()').extract() + In [4]: hxs.select('//title/text()').extract() Out[4]: [u'Open Directory - Computers: Programming: Languages: Python: Books'] - In [5]: hxs.select('/html/head/title/text()').re('(\w+):') + In [5]: hxs.select('//title/text()').re('(\w+):') Out[5]: [u'Computers', u'Programming', u'Languages', u'Python'] Extracting the data