简体   繁体   中英

I don't understand how to print scrapy data in a table

I've seen several things, but I'm not able to play this in a table or.csv to print the table on the screen, can anyone help me?

I'm lost

import scrapy

class SinonimoSpider(scrapy.Spider):
    name = 'sinonimo'
    start_urls = ['https://www.sinonimos.com.br/pedido/']

    def parse(self, response):
        for i in response.css('.sinonimo'):
            yield{
                'sinonimo': i.css('a.sinonimo ::text').get()

            }

Do you mean you are unable to see the data and want the spider to store the data in CSV? There are many ways to do it. The most popular one that we use when we run the spider from the terminal

$ scrapy crawl sinonimo -O sinonimo.csv # in case of CSV
$ scrapy crawl sinonimo -O sinonimo.json # in case of json

If you need any help, just leave a comment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM