def parse_job(self, response):
"""Parse a joblink into a JobItem.
"""
s = Selector(response)
item = JobItem()
item['url'] = response.url
item['site'] = 'Remote.co'
item['title'] = s.css('h1::text').extract_first()
item['company'] = s.xpath(
'//strong[@itemprop="name"]/text()').extract_first()
job = s.css('.job-description')
job.xpath('p[1]')
item['text'] = s.xpath(
'//div[@class="job_description"]//text()').extract()
try:
posted = s.xpath('//time//text()').extract_first()
item['date_posted'] = utilities.naturaltime(
posted.replace('Posted ', '')).isoformat()
except Exception as e:
self.logger.error(e)
yield item
评论列表
文章目录