Sha256: edb7ff01aeea0f94974db21f65bc32e3bd9dd4deda4e80d225795e138e470136

Contents?: true

Size: 752 Bytes

Versions: 1

Compression:

Stored size: 752 Bytes

Contents

class DigitalNomadJobs::Scraper

  def self.scrape_jobs(url)
    html = open(url)
    doc = Nokogiri::HTML(html)
    posts = doc.css(".company_and_position_mobile")

    job_array = posts.first(20).collect do |post|
      {:title => post.css('h2').text, 
      :company => post.css('.preventLink h3').text,
      :job_url => post.css('a')[0]['href'],
      :company_url => post.css('a')[1]['href'],}
    end
  end  

  def self.scrape_descriptions(job_url)
    html = open(job_url)
    page = Nokogiri::HTML(html)

    details = {}
    details[:description] = page.css('.description').text
    details[:time_posted] = page.css('.time').text
    details[:skills] = page.css('.tags').text.gsub('3>', ' | ').insert(0,' | ')
    
    details
  end 


end
 

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
digital_nomad_jobs-0.1.0 lib/digital_nomad_jobs/scraper.rb