Scrapy, a fast high-level web crawling & scraping framework for Python.
Remove "sel" shortcut from scrapy shell$
Daniel Grañad37308ad77ec
diff --git a/scrapy/shell.py b/scrapy/shell.pyindex 6d81e0760..03024af4c 100644--- a/scrapy/shell.py+++ b/scrapy/shell.py@@ -15,7 +15,6 @@ from scrapy.crawler import Crawlerfrom scrapy.exceptions import IgnoreRequestfrom scrapy.http import Request, Responsefrom scrapy.item import BaseItem-from scrapy.selector import Selectorfrom scrapy.settings import Settingsfrom scrapy.spider import Spiderfrom scrapy.utils.console import start_python_console@@ -27,7 +26,7 @@ from scrapy.utils.spider import create_spider_for_requestclass Shell(object):relevant_classes = (Crawler, Spider, Request, Response, BaseItem,- Selector, Settings)+ Settings)def __init__(self, crawler, update_vars=None, code=None):self.crawler = crawler@@ -99,7 +98,6 @@ class Shell(object):self.vars['spider'] = spiderself.vars['request'] = requestself.vars['response'] = response- self.vars['sel'] = Selector(response)if self.inthread:self.vars['fetch'] = self.fetchself.vars['view'] = open_in_browserdiff --git a/scrapy/tests/test_command_shell.py b/scrapy/tests/test_command_shell.pyindex 1fbb4b28a..a56236d54 100644--- a/scrapy/tests/test_command_shell.py+++ b/scrapy/tests/test_command_shell.py@@ -31,7 +31,7 @@ class ShellTest(ProcessTest, SiteTest, unittest.TestCase):@defer.inlineCallbacksdef test_response_selector_html(self):- xpath = 'sel.xpath("//p[@class=\'one\']/text()").extract()[0]'+ xpath = 'response.xpath("//p[@class=\'one\']/text()").extract()[0]'_, out, _ = yield self.execute([self.url('/html'), '-c', xpath])self.assertEqual(out.strip(), 'Works')