Я пытаюсь получить элементы из этого LIST , но я не могу сканировать эти элементы, потому что я знаю только сканирование списка с URL, но теперь мне нужно сканировать список без URL
Мойкод
class MercadoSpider(CrawlSpider):
name = 'mercado'
item_count = 0
contador=2
allowed_domain = ['https://transparencia.gob.es/']
def start_requests(self):
for i in range (self.contador):
#yield Request('https://www.qdq.com/search?location=Ver%20resultados%20en%20toda%20Espa%C3%B1a&query=abogados&ine_code=&kind=N&page='+str(i),
yield Request('https://transparencia.gob.es/servicios-buscador/buscar.htm?categoria=bienesinmuebles_ind&categoriasPadre=ecopre&lang=es&pag='+str(i),
callback=self.parse)
rules = {
# Para cada item
#Rule(LinkExtractor(allow = (), restrict_xpaths = ('/html/body/div[1]/div/div/section/article/header/p[2]/a[10]/@href'))),
Rule(LinkExtractor(allow =(), restrict_xpaths = ('normalize-space(/html/body/div[1]/div/div/section/article/header/table/tbody/tr[1]/td[2]/text())"]')),
callback = 'parse_item', follow = True)
}
def parse_item(self, response):
ml_item = MercadoItem()
#info de producto
ml_item['uso'] = response.xpath('normalize-space(/html/body/div[1]/div/div/section/article/header/table/tbody/tr[1]/td[3]/text())').extract()
ml_item['localizacion'] = response.xpath('normalize-space(/html/body/div[1]/div/div/section/article/header/table/tbody/tr[1]/td[2]/text())').extract()
#data = response.xpath('/html/head/script[3]/text()').extract()
#phone_number = re.search(r'"telephone":"(.*?)","address"', str(data)).group(1)
#ml_item['uso']= phone_number
ml_item['superficie'] = response.xpath('normalize-space(/html/body/div[1]/div/div/section/article/header/table/tbody/tr[1]/td[4]/text())').extract()
ml_item['tipo'] = response.xpath('/html/body/div[1]/div/div/section/article/header/table/tbody/tr[1]/td[1]/span/text()').extract()
#ciudad = re.search(r'"addressRegion":"(.*?)","postalCode"', str(comunidad)).group(1)
#ml_item['ciudad']= ciudad
Я пытаюсь изменить значение Follow на true, но не сработало, ошибки возврата нет, но мой .CSV пуст