class AtpScraper::Html

Get and parse html from atpworldtour.com

Constants

BASE

Public Class Methods

get(uri) click to toggle source
# File lib/atp_scraper/html.rb, line 7
def self.get(uri)
  charset = nil
  html = open(BASE + uri) do |f|
    charset = f.charset
    f.read
  end
  { html: html, charset: charset }
end
parse(html, charset) click to toggle source
# File lib/atp_scraper/html.rb, line 16
def self.parse(html, charset)
  Nokogiri::HTML.parse(html, nil, charset)
end