【发布时间】:2018-01-24 00:10:43
【问题描述】:
我正在尝试从网站上删除几个页面。 为此,我使用循环来添加我的 URL 的页码。 当我启动我的蜘蛛时,我遇到了这个错误。 我将引用从单引号更改为双引号,或者检查是否有空格,但 URL 似乎很好。
你知道出了什么问题吗?
我的循环
> def url_lister():
> url_list = []
> page_count = 0
> while page_count < 2:
> url = "['https://www.active.com/running?page=%s" %page_count + "']"
> url_list.append(url)
> print(url)
> page_count += 1
> return url_list
以下是结果网址
['https://www.active.com/running?page=0']
-----------------------------
['https://www.active.com/running?page=1']
-----------------------------
["['https://www.active.com/running?page=0']", "['https://www.active.com/running?page=1']"]
-----------------------------
这是消息错误
2018-01-23 14:31:34 [scrapy.middleware] INFO: Enabled item pipelines:
['ACTIVE.pipelines.ActivePipeline']
2018-01-23 14:31:34 [scrapy.core.engine] INFO: Spider opened
2018-01-23 14:31:34 [scrapy.extensions.logstats] INFO: Crawled 0 pages (at 0 pages/min), scraped 0 items (at 0 items/min)
2018-01-23 14:31:34 [scrapy.extensions.telnet] DEBUG: Telnet console listening on 127.0.0.1:6023
2018-01-23 14:31:34 [scrapy.downloadermiddlewares.robotstxt] ERROR: Error downloading <GET :///robots.txt>: Unsupported URL scheme '': no handler available for that scheme
【问题讨论】: