mirror of https://github.com/scrapy/scrapy.git
Merge pull request #2503 from redapple/view-no-redirect
[MRG] Fix view command against new --no-redirect option
This commit is contained in:
commit
c305c46254
|
|
@ -358,6 +358,12 @@ Opens the given URL in a browser, as your Scrapy spider would "see" it.
|
|||
Sometimes spiders see pages differently from regular users, so this can be used
|
||||
to check what the spider "sees" and confirm it's what you expect.
|
||||
|
||||
Supported options:
|
||||
|
||||
* ``--spider=SPIDER``: bypass spider autodetection and force use of specific spider
|
||||
|
||||
* ``--no-redirect``: do not follow HTTP 3xx redirects (default is to follow them)
|
||||
|
||||
Usage example::
|
||||
|
||||
$ scrapy view http://www.example.com/some/page.html
|
||||
|
|
|
|||
|
|
@ -11,9 +11,8 @@ class Command(fetch.Command):
|
|||
"contents in a browser"
|
||||
|
||||
def add_options(self, parser):
|
||||
ScrapyCommand.add_options(self, parser)
|
||||
parser.add_option("--spider", dest="spider",
|
||||
help="use this spider")
|
||||
super(Command, self).add_options(parser)
|
||||
parser.remove_option("--headers")
|
||||
|
||||
def _print_response(self, response, opts):
|
||||
open_in_browser(response)
|
||||
|
|
|
|||
Loading…
Reference in New Issue