0

import scrapy from ..items import MatchesfashionItem

class SpiderSpider(scrapy.Spider): name = 'spider'

start_urls = ['https://www.matchesfashion.com/intl/mens/shop/shoes']

def parse(self, response):
    items=MatchesfashionItem()
    Name = response.css('.lister__item__details::text').extract()
    Brand = response.css('.lister__item__title::text').extract()
    Price = response.css('.lister__item__price-full::text').extract()
    Image_Url = response.css('div.lister__item__image productView').css('a').css('img::attr(src)')
    Product_Url = response.css('.lister__item__inner').css('div.lister__item__image').css('a::attr(href)').extract()

    items['Name'] = Name
    items['Brand'] = Brand
    items['Price'] = Price
    items['Image_Url'] = Image_Url
    items['Product_Url'] = Product_Url

    yield items

1 Answers1

0

It might be because some of the content including the images are being generated by javascript and then rendered on the DOM.

Check the answers here might be helpful: Web-scraping JavaScript page with Python

Mo_-
  • 574
  • 3
  • 6