In [1]: sel.xpath('//title') Out[1]: [<Selector (title) xpath=//title>]
What happened to me
In [3]: sel.xpath('//title')
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-3-7519afbb1d35> in <module>()
----> 1 sel.xpath('//title')
NameError: name 'sel' is not defined
Why am I receiving this error and how can I fix it. I am on Ubuntu 13.10.
Not sure if this is relevant but there is a warning about 'frontend'
/tutorial$ scrapy shell "http://www.dmoz.org/Computers/Programming/Languages/Python/Books/"
...
2013-10-22 22:29:26+1100 [default] DEBUG: Crawled (200) <GET http://www.dmoz.org/Computers/Programming/Languages/Python/Books/> (referer: None)
[s] Available Scrapy objects:
[s] hxs <HtmlXPathSelector xpath=None data=u'<html>\r\n<head>\r\n<meta http-equiv="Conten'>
[s] item {}
[s] request <GET http://www.dmoz.org/Computers/Programming/Languages/Python/Books/>
[s] response <200 http://www.dmoz.org/Computers/Programming/Languages/Python/Books/>
[s] settings <CrawlerSettings module=<module 'tutorial.settings' from '/home/sayth/scrapy/tutorial/tutorial/settings.pyc'>>
[s] spider <BaseSpider 'default' at 0x37b9f50>
[s] Useful shortcuts:
[s] shelp() Shell help (print this help)
[s] fetch(req_or_url) Fetch request (or URL) and update local objects
[s] view(response) View response in a browser
/usr/local/lib/python2.7/dist-packages/IPython/frontend.py:30: UserWarning: The top-level `frontend` package has been deprecated. All its subpackages have been moved to the top `IPython` level.
warn("The top-level `frontend` package has been deprecated. "
Thanks
Sayth
Thanks
Sayth