Sha256: 59945514802ca8064cc22c21d92485d3ee795a2e08892629391538640ecd6527

Contents?: true

Size: 702 Bytes

Versions: 7

Compression:

Stored size: 702 Bytes

Contents

#url = https://oceana.org/marine-life/sharks-rays
#shark and ray index page = <section class="block-callout-action-contain inner-contain flex-contain-wrap">
#link to profile page = <div class="overlay"> <a href>

require 'open-uri'
require 'nokogiri'
require 'pry'

class Shark::Scraper
    attr_accessor :sharks

    @@all = []

    def get_page
        Nokogiri::HTML(open('https://oceana.org/marine-life/sharks-rays'))
    end 

    def scrape_shark_encyclopedia
      self.get_page.css("section.block-callout-action-contain article")
    end 

    def make_sharks
      scrape_shark_encyclopedia.each do |shark|
        Shark::SharkRays.new_from_shark_index(shark)
      end 
    end 
  end 

   

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
shark-scraper-cli-0.1.6 lib/shark/shark_scraper.rb
shark-scraper-cli-0.1.5 lib/shark/shark_scraper.rb
shark-scraper-cli-0.1.4 lib/shark/shark_scraper.rb
shark-scraper-cli-0.1.3 lib/shark/shark_scraper.rb
shark-scraper-cli-0.1.2 lib/shark/shark_scraper.rb
shark-scraper-cli-0.1.1 lib/shark/shark_scraper.rb
shark-scraper-cli-0.1.0 lib/shark/shark_scraper.rb