From ebdb733e9554f13d9e08ffd515e04dc7c03c04fe Mon Sep 17 00:00:00 2001 From: Pablo Hoffman Date: Sun, 5 Sep 2010 04:45:43 -0300 Subject: [PATCH] Updated some old messages in Scrapy shell doc --- docs/topics/shell.rst | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/docs/topics/shell.rst b/docs/topics/shell.rst index 5bed14884..daa8d83d0 100644 --- a/docs/topics/shell.rst +++ b/docs/topics/shell.rst @@ -132,17 +132,30 @@ After that, we can star playing with the objects:: >>> hxs.select("//h2/text()").extract()[0] u'Welcome to Scrapy' + >>> fetch("http://slashdot.org") - Fetching ... - Done - use shelp() to see available objects + [s] Available Scrapy objects: + [s] hxs + [s] item JobItem() + [s] request + [s] response <200 http://slashdot.org> + [s] settings + [s] spider + [s] xxs + [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 + >>> hxs.select("//h2/text()").extract() [u'News for nerds, stuff that matters'] - >>> request = request.replace(method="POST") - >>> fetch(request) - Fetching ... - 2009-04-03 00:57:39-0300 [scrapybot] ERROR: Downloading from : 405 Method Not Allowed - >>> + >>> request = request.replace(method="POST") + + >>> fetch(request) + 2009-04-03 00:57:39-0300 [default] ERROR: Downloading from : 405 Method Not Allowed + + >>> .. _topics-shell-inspect-response: @@ -171,9 +184,9 @@ When you run the spider, you will get something similar to this:: 2009-08-27 19:15:25-0300 [example.com] DEBUG: Crawled (referer: ) 2009-08-27 19:15:26-0300 [example.com] DEBUG: Crawled (referer: ) - - Scrapy Shell - inspecting response: + ... >>> response.url 'http://www.example.com/products.php'