Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

issue GH #1550 - fixed error: shell command wasn't accepting files URIs

Leonid Amirov98a2e77a75f0
diff --git a/scrapy/commands/shell.py b/scrapy/commands/shell.py
index 92ebbe605..f10da4370 100644
--- a/scrapy/commands/shell.py
+++ b/scrapy/commands/shell.py
@@ -5,11 +5,11 @@ See documentation in docs/topics/shell.rst
"""
from threading import Thread
+from w3lib.url import any_to_uri
from scrapy.commands import ScrapyCommand
from scrapy.shell import Shell
from scrapy.http import Request
-from scrapy.utils.url import add_http_if_no_scheme
from scrapy.utils.spider import spidercls_for_request, DefaultSpider
@@ -43,7 +43,8 @@ class Command(ScrapyCommand):
def run(self, args, opts):
url = args[0] if args else None
if url:
- url = add_http_if_no_scheme(url)
+ url = any_to_uri(url)
+
spider_loader = self.crawler_process.spider_loader
spidercls = DefaultSpider