gpt4 book ai didi

web-scraping - 抓取错误 : 'NotSupported: Unsupported URL scheme ' ': no handler available for that scheme'

转载 作者:行者123 更新时间:2023-12-04 05:06:39 27 4
gpt4 key购买 nike

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

'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/']

关于web-scraping - 抓取错误 : 'NotSupported: Unsupported URL scheme ' ': no handler available for that scheme',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43193833/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com