runspider:错误:找不到文件:test

时间:2017-09-20 12:57:27

标签: python scrapy

C:\WINDOWS\system32>scrapy runspider test.py
2017-09-20 18:09:39 [scrapy.utils.log] INFO: Scrapy 1.4.0 started (bot: scrapybot)
2017-09-20 18:09:39 [scrapy.utils.log] INFO: Overridden settings: {'SPIDER_LOADER_WARN_ONLY': True}
Usage
=====
  scrapy runspider [options] <spider_file>`enter code here`

runspider: error: File not found: test.py

C:\WINDOWS\system32>scrapy runspider test
2017-09-20 17:43:20 [scrapy.utils.log] INFO: Scrapy 1.4.0 started (bot: scrapybot)
2017-09-20 17:43:20 [scrapy.utils.log] INFO: Overridden settings: {'SPIDER_LOADER_WARN_ONLY': True}
Usage
=====
  scrapy runspider [options] <spider_file>

runspider: error: File not found: test

我尝试了命令抓取,但它也无法正常工作

我不知道代码是否正确

import scrapy


class testspider(scrapy.Spider):
name = "test"
start_urls = ['http://moviediwali.xyz']

def parse(self, response):
    SET_SELECTOR = '.set'
    for moviediwali in response.css(SET_SELECTOR):

        NAME_SELECTOR = 'h1 a ::text'
        yield {
            'name': moviediwali.css(NAME_SELECTOR).extract_first(),
        }

0 个答案:

没有答案