Scrapy Error: 'NotSupported: Unsupported URL scheme '': no handler available for that scheme'

Scrapy Error: 'NotSupported: Unsupported URL scheme '': no handler available for that scheme'

我正在尝试删除网站,但在 运行 脚本时,出现以下错误

'NotSupported: Unsupported URL scheme '': no handler available for that scheme'

如果规则没有错,为什么会出现,有什么建议,请帮帮我。非常感谢。

代码在这里:

from scrapy.spiders import CrawlSpider, Rule, BaseSpider
from scrapy.linkextractors import LinkExtractor 
class FellowSearch(CrawlSpider):
    name ='fellow'
    allowed_domains = ['emma.cam.ac.uk']
    start_urls = [' https://www.emma.cam.ac.uk/']

    rules =(Rule(LinkExtractor(allow=(r'\?id=\d+$')),callback='parse_obj', follow=True),)

    def parse_obj(self, response):
        print response.url

您需要在将 start_urls 中的 https 更改为 start_urls = ['https://www.emma.cam.ac.uk/'] 之前删除 space。