Estou começando a aprender scrapy e criei a seguinte função:
import scrapy
class ModelSpider(scrapy.Spider):
name = "model"
start_urls = [
'http://www.icarros.com/'
]
def parse(self, response):
with open('brands.csv', 'r') as all_brands:
for brand in all_brands:
brand = brand.replace("\n", "")
url = 'http://www.icarros.com/'+brand
yield scrapy.Request(url, self.success_connect)
def success_connect(self, response):
self.log('Entrei')
Mas aparece o seguinte erro:
AttributeError: 'ModelSpider' object has no attribute 'success_connect'