Al intentar obtener todos los artículos de la pagina consultada solo obtengo el primer registro tantas veces artículos hayan en la URL consultada.
class MercadoSpider(scrapy.Spider):
name = 'mercado'
allowed_domain = ['www.mercadolibre.com.ar']
start_urls = ['https://videojuegos.mercadolibre.com.ar/videojuegos/ps4/fisico/_DisplayType_LF_PriceRange_1200-2500']
def parse(self, response):
for articulo in response.xpath('//li[@class="ui-search-layout__item"]'):
precio= articulo.xpath('//span[@class="price-tag-fraction"]//text()').get()
titulo= articulo.xpath('//h2[@class="ui-search-item__title"]//text()').get()
yield {
'price': precio,
'title': titulo
}
Así se vería la salida a modo de ejemplo
[
{"price": "2.099", "title": "Plants vs. Zombies: Garden Warfare 2 Standard Edition Electronic Arts PS4 F\u00edsico"},
{"price": "2.099", "title": "Plants vs. Zombies: Garden Warfare 2 Standard Edition Electronic Arts PS4 F\u00edsico"},
{"price": "2.099", "title": "Plants vs. Zombies: Garden Warfare 2 Standard Edition Electronic Arts PS4 F\u00edsico"},
{"price": "2.099", "title": "Plants vs. Zombies: Garden Warfare 2 Standard Edition Electronic Arts PS4 F\u00edsico"},
{"price": "2.099", "title": "Plants vs. Zombies: Garden Warfare 2 Standard Edition Electronic Arts PS4 F\u00edsico"},
{"price": "2.099", "title": "Plants vs. Zombies: Garden Warfare 2 Standard Edition Electronic Arts PS4 F\u00edsico"},
{"price": "2.099", "title": "Plants vs. Zombies: Garden Warfare 2 Standard Edition Electronic Arts PS4 F\u00edsico"},
{"price": "2.099", "title": "Plants vs. Zombies: Garden Warfare 2 Standard Edition Electronic Arts PS4 F\u00edsico"}
]
Gracias.-