为什么每行之间的CSV之间有空格?

时间:2018-05-21 14:36:45

标签: python scrapy scrapy-spider

当我在命令行中运行此代码时; scrapy crawl确实-o items.csv,我收到一行输出,每行之间有空格。见图。我该如何解决这个问题?

enter image description here

import scrapy

class IndeedSpider(scrapy.Spider):
    name = 'indeed'
    allowed_domains = ['indeed.nl']
    start_urls = ['https://www.indeed.nl/vacatures?q=developer&l=']

    def parse(self, response):
        jobs =response.xpath('//div[@class="  row  result" or 
        @class="lastRow  row  result"]')
        for job in jobs:
            jobtitle = job.xpath('h2/a/@title').extract_first()
            company = 
            job.xpath('.//span[@class="company"]/text()').extract_first()

            yield{
                'jobtitle': jobtitle, 
                'company': company}

0 个答案:

没有答案