Doubt regarding callback and the meaning of below line

can you please explain what is callback

yield scrapy.Requests(url = url,callback = self.parse)

AttributeError: module ‘scrapy’ has no attribute ‘spider’
this error accurs help

A callback is an idea of passing a function as a parameter to another function and have this one invoked once the process has completed.
According to the doc for spiders, the scraping cycle goes through something like this:

  1. You start by generating the initial Requests to crawl the first URLs, and specify a callback function to be called with the response downloaded from those requests.

  2. The first requests to perform are obtained by calling the start_requests() method which (by default) generates Request for the URLs specified in the start_urls and the parse method as callback function for the Requests.

  3. In the callback function, you parse the response (web page) and return either dicts with extracted data.

Might be the version issue use pip install scrapy --upgrade

If it’s not a version issue, uninstall scrapy and then reinstall it. Make sure it completes without any error.

Make sure you don’t have another file called scrapy.py in the directory you are running because it will be imported before the real scrapy module.