Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter3.Article"Crawling with Scrapy". NotImplementedError #59

Open
stiv1256 opened this issue Mar 12, 2018 · 0 comments
Open

Chapter3.Article"Crawling with Scrapy". NotImplementedError #59

stiv1256 opened this issue Mar 12, 2018 · 0 comments

Comments

@stiv1256
Copy link

stiv1256 commented Mar 12, 2018

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...

@stiv1256 stiv1256 reopened this Mar 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant