REMitchell/python-scraping

Chapter3.Article"Crawling with Scrapy". NotImplementedError

stiv1256 opened this issue · 0 comments

Hi everybody! I am newbie and try to implement my first test scrapy project wikiSpider . I done everything as described in the book and got the result- NotImplementedError: ArticleSpider.parse callback is not defined.

files:
-articleSpider.py:
from scrapy.selector import Selector
from scrapy import Spider
from wikiSpider.items import Article

class ArticleSpider(Spider):
name="article"
allowed_domains = ["en.wikipedia.org"]
start_urls = ["http://en.wikipedia.org/wiki/Main_Page",
"http://en.wikipedia.org/wiki/Python_%28programming_language%29"]

def parse(self, response):
item = Article()
title = response.xpath('//h1/text()')[0].extract()
print("Title is: "+title)
item['title'] = item
return item

-items.py

from scrapy import Item, Field

class Article(Item):
# define the fields for your item here like:
# name = scrapy.Field()
title=Field()

More details you can see here...
![mypic1](https://user-images.githubusercontent.com/29522625/37275003-b2660ff0-25e6-11e8-9b35-1a3afe85ebdd.jpg

Can anybody help me? Thnx in advance...