Save Excel file to Python via Scrapy

Asked

Viewed 458 times

0

As I do for mine Spider save all Excel data in a single XML file links which I extract? Or also save in each single XLS file in the project folder?

Part of my Spider:

def parse(self, response):
    divs = response.xpath('''meu caminho html''')
    for div in divs:
        #o arquivo xls sai dessa html
        links = div.xpath('.//a/@href').extract_first()
        yield {'Links': links,}

1 answer

1

The excel export format is not supported, but scrapy supports:

  • JSON
  • JSON Ines
  • CSV
  • XML

You can use CSV format:

scrawl nome_do_spider -t csv -o planilha.csv

Browser other questions tagged

You are not signed in. Login or sign up in order to post.