Scrapy: NameError: global name 'MyItem' is not defined
<p>I'm trying to fill my Items with parsed data and I'm getting error: <strong>NameError: global name 'QuotesItem' is not defined</strong>
when trying to run <strong>$ scrapy crawl quotes</strong></p>

<p>Here's my spider's code: </p>

<p>quotes.py:</p>

<pre><code>import scrapy

class QuotesSpider(scrapy.Spider):
name = "quotes"

def start_requests(self):
start_urls = [
        'http://www.successories.com/iquote/category/39/inspirational-quotes/4',
        'http://www.successories.com/iquote/category/39/inspirational-quotes/6',
        'http://www.successories.com/iquote/category/39/inspirational-quotes/7',
        'http://www.successories.com/iquote/category/39/inspirational-quotes/8',
        'http://www.successories.com/iquote/category/39/inspirational-quotes/9',
        ]

def parse(self,response):
  items = []
  for quote in response.css('div.quotebox'):
    item = QuotesItem()
    item['quoteAuthor'] =  quote.css('div.quote a::text').extract_first()
    item['quoteText'] = quote.css('div.quote a::text').extract_first()
    items.append(item)
    yield items
</code></pre>

<p>Here's my items code
items.py:</p>

<pre><code>import scrapy

class QuotesItem(scrapy.Item):
    quoteAuthor = scrapy.Field()
    quoteText = scrapy.Field()
</code></pre>

<p>You've defined <code>QuotesItem</code> in another file called <code>items.py</code>. Now you have to <a href="https://docs.python.org/3.5/tutorial/modules.html" rel="nofollow">import</a> either the entire module <code>items</code> or just the <code>QuotesItem</code>. Add the following to the top of your <code>quotes.py</code>:</p>

<pre><code>from items import QuotesItem
</code></pre>

python scrapy