Python Scraping Data From the Web Additional Scraping Tasks An Intelligent Spider

Marcus Schumacher
Marcus Schumacher
12,185 Points

I don't see the contents of after_post printing when I run my spider

from scrapy.http import FormRequest
from scrapy.spiders import Spider

class FormSpider(Spider):

    name = 'horseForm'
    start_urls = ['']

    def parse(self, response):
        formdata = {'firstname': 'Ken',
                    'lastname': 'Alger',
                    'jobtitle': 'Teacher'}
        return FormRequest.from_response(response, formnumber=0, formdata=formdata, callback=self.after_post)

    def after_post(self, response):
        print('\n\n********\nForm processed.\n')

Then I go to the proper directory and run scrapy crawl horseForm. What am I doing wrong?