[Python] Scrapy script not scraping items

Discussão em 'Python' iniciado por Stack, Agosto 26, 2025.

  1. Stack

    Stack Membro Participativo

    I'm not sure why my script isn't scraping any items, it is the same script that I'm using for another website. Maybe the classes I'm using are wrong.

    import scrapy
    import os
    from scrapy.crawler import CrawlerProcess
    from datetime import datetime

    date = datetime.now().strftime("%d_%m_%Y")

    class stiendaSpider(scrapy.Spider):
    name = 'stienda'
    start_urls = ['https://stienda.uy/tv']

    def parse(self, response):
    for products in response.css('.grp778'):
    price = products.css('.precioSantander::text').get()
    name = products.css('#catalogoProductos .tit::text').get()
    if price and name:
    yield {'name': name.strip(),
    'price': price.strip()}

    os.chdir('C:\\Users\\cabre\\Desktop\\scraping\\stienda\\data\\raw')
    process = CrawlerProcess(
    # settings={"FEEDS": {"items.csv": {"format": "csv"}}}
    settings={"FEEDS": {f"stienda_{date}.csv": {"format": "csv"}}}
    )
    process.crawl(stiendaSpider)
    process.start()


    Why is it not working?

    Continue reading...

Compartilhe esta Página