I get some message from pylint rules :
from scrapy.spiders import Spider
class MySpider(Spider): #Undefined variable "Spider"
name = "get"
start_urls = [""]
def __init__(self,**kwargs):
self.page_num = 1 #Undefined variable "self"
super(MySpider, self).__init__()
def parse(self, response):
sel = Selector(response) #Undefined variable "response"
sites = sel.css("") #Undefined variable "sel"
category_projects_list = []
for site in sites: #Undefined variable "site"
project_count = site.css("")
category_name = site.css("").extract()
category_projects = {}
category_projects['project_count'] = project_count[0] #Undefined variable "category_projects" #Undefined variable "project_count"
I am a little confused how to edit the code
It is means I have declare it before I used??
Spider=None
self=None
response= None
sel=None
site=None
...
But the Spider is from from scrapy.spiders import Spider
How should I declare it??
And I think category_projects = {}
is declare the variable
But the next line said Undefined variable "category_projects"
I want to know how to edit the code to match the rules??
So that I can have a reference to modify other code