I'm trying to crawl this website
I'm trying to go into each product and fetch its name and price and other stuffs but I'm facing an issue that is new to me.
there are totally 1800+ products , and all have same xpaths which I want to scrape. but it only scraped 96. what could be the issue?
import scrapy
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
class AutopartSpider(CrawlSpider):
name = 'Autopart'
allowed_domains = ['www.ebay.com']
start_urls = ['https://www.ebay.com/sch/i.html?_dmd=2&_dkr=1&iconV2Request=true&_ssn=a2z_prime_auto_parts&store_name=a2zprimeautoparts&_oac=1']
rules = (
Rule(LinkExtractor(restrict_xpaths="//div[@class ='s-item__info clearfix']/a"), callback='parse_item', follow=True),
Rule(LinkExtractor(restrict_xpaths="//a[@class='pagination__next icon-link']"))
)
def parse_item(self, response):
yield{
'part_name':response.xpath("//div[@class='vim x-item-title']/h1/span/text()").get()
}
