zoukankan      html  css  js  c++  java
  • 运行scrapy保存图片,报错ValueError: Missing scheme in request url: h

    查阅相关资料,了解到使用ImagesPipeline传入的url地址必须是一个list,而我写的是一个字符串,所以报错,所以需要修改一下传入的url格式就行了

     def parse_detail(self, response):
            # print(response)
            item = JobBoleItem()
            # note:把字符创修改为列表即可
            item['front_image_url'] = [response.meta.get('front_image_url', '')] # 文章封面图
            item["title"] = response.css('.entry-header h1::text').extract_first()
            content_list = response.css('.entry p::text').extract()
            item["content"] = ''.join(content_list)
            item["tags"] = ''.join(response.css('.post-adds span::text').extract()).strip()
            # print(title,content,tags)
    
            yield item
    

      

  • 相关阅读:
    char类型细节
    Hibernate面试题
    线程
    IO流
    集合
    链表相关的一点东西
    正则表达式学习
    python中的变量域问题
    python的输出和输入形式
    python mutable 和 immutable
  • 原文地址:https://www.cnblogs.com/royfans/p/8378495.html
Copyright © 2011-2022 走看看