看法¶
在浏览器中打开给定的URL,因为您的废蜘蛛会“看到”它。有时候蜘蛛看到的页面与普通用户不同,所以这可以用来检查蜘蛛“看到”什么,并确认它是你所期望的。 支持的选项:
使用实例: $ scrapy view http://www.example.com/some/page.html
[ ... browser starts ... ]
壳¶
为给定的URL(如果给定)启动scrapy shell;如果没有给定URL,则为空。还支持Unix风格的本地文件路径,无论是相对于 支持的选项:
使用实例: $ scrapy shell http://www.example.com/some/page.html
[ ... scrapy shell starts ... ]
$ scrapy shell --nolog http://www.example.com/ -c '(response.status, response.url)'
(200, 'http://www.example.com/')
# shell follows HTTP redirects by default
$ scrapy shell --nolog http://httpbin.org/redirect-to?url=http%3A%2F%2Fexample.com%2F -c '(response.status, response.url)'
(200, 'http://example.com/')
# you can disable this with --no-redirect
# (only for the URL passed as command line argument)
$ scrapy shell --no-redirect --nolog http://httpbin.org/redirect-to?url=http%3A%2F%2Fexample.com%2F -c '(response.status, response.url)'
(302, 'http://httpbin.org/redirect-to?url=http%3A%2F%2Fexample.com%2F') |
Archiver|手机版|笨鸟自学网 ( 粤ICP备20019910号 )
GMT+8, 2024-11-21 20:57 , Processed in 0.024019 second(s), 17 queries .