Scrapy spider not found error

后端 未结 21 2373
感情败类
感情败类 2021-02-02 06:58

This is Windows 7 with python 2.7

I have a scrapy project in a directory called caps (this is where scrapy.cfg is)

My spider is located in caps\\caps\\spiders\\c

21条回答
  •  我在风中等你
    2021-02-02 07:09

    Ahh Yes, you should enter the value of your 'name variable value'.

    I.e.

    import scrapy
    
    class QuoteSpider(scrapy.Spider):
        name = 'quotes'
        start_urls = [
            'http://quotes.toscrape.com/'
        ]
    
        def parse(self, response):
            title = response.css('title').extract()
            yield {'titleText' : title}
    

    So in this case, the name = 'quotes'. Then in your command line you enter: 'scrapy crawl quotes'

    That was my problem.

提交回复
热议问题