1

Есть паук на Scrapy обходит половину страниц и останавливается до конечной не доходит в чём
может быть причина?

import scrapy


class QuotesSpider(scrapy.Spider):
name = "quotes"
start_urls = [
    'https://www.wildberries.ru/catalog/elektronika/noutbuki-periferiya/kompyutery? 
      sort=popular&page=1',
]



def parse(self, response):
    for quote in response.css('div.j-card-item'):
        yield {
            # 'link': res,
            'name': quote.css('span.goods-name::text').get(),
            'brend': quote.css('strong.brand-name::text').get(),
            'price': quote.css('ins.lower-price::text').get()
        }

    next_page = response.css('div.pageToInsert a::attr(href)').get()
    if next_page is not None:
        next_page = response.urljoin(next_page)
        yield scrapy.Request(next_page, callback=self.parse)
2
  • 1
    павук которому не повезло
    – finally
    25 дек 2021 в 7:58
  • не понял а чем ему не повезло? 25 дек 2021 в 13:53

0

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Посмотрите другие вопросы с метками или задайте свой вопрос.