Q:

Scrapy error on Scraping

Here is what I trying to do.  I want to scrape emails from a number of websites. I have a file using which I can input the scrapy all the list of url. This is how I tried to extract email:  
import scrapy
import datetime
import re
from scrapy.spiders import CrawlSpider
from techfinder.items import EmailItem
from scrapy.selector import HtmlXPathSelector

class DetectSpider(scrapy.Spider):
    name = "test"

    start_urls = ["http://example.com"]#[url.strip() for url in starturlfile.readlines()]

    def parse(self, response):

        DOWNLOADER_MIDDLEWARES = 
        {
            'scrapy_proxy_rotator.ProxyMiddleware': 1,
        }

        PROXY_ROTATOR = 
        {
            'username': 'user1',
            'password': 'pass1',
            'proxies_file': 'proxies.txt',
        }
        emails = re.findall(r'[\w\.-]+@[\w\.-]+', response.body)        
        emailitems = []
        for email in zip(emails):
            emailitem = EmailItem()
            emailitem["email"] = emails
            emailitem["source"] = response.url

        return emailitems

I ran the command as:  
scrapy runspider scrapyDemo.py -o t.json -t json

And got the error:  
2017-02-09 12:58:34 [scrapy.utils.log] INFO: Scrapy 1.3.0 started (bot: scrapybot)
2017-02-09 12:58:34 [scrapy.utils.log] INFO: Overridden settings: {'FEED_FORMAT': 'json', 'FEED_URI': 't.json'}
Usage
=====
  scrapy runspider [options] <spider_file>

runspider: error: Unable to load 'scrapyDemo.py': No module named techfinder.items

Why I am getting this error? Also how I can crawl the complete website and get the emails in an optimized way using my program? I am using proxy rota tor for multiple proxy support. If possible how I can add user-agent definition in my code?
Kindly help me with this problem.
Please let me tell you I am not scraping emails for spam. As I have many of the website I trying to acquire the emails from it.

A:

In run spider command you need to use not a filename but a Spider name, which is set as an attribute in class:
class DetectSpider(scrapy.Spider):
    name = "test"
    ....

So:
$ scrapy runspider test  -o t.json -t json

