Sha256: bf6b05db44d77c4b9af7fe9d8978174686edebc1649315e76398911217f3ce74
Contents?: true
Size: 434 Bytes
Versions: 9
Compression:
Stored size: 434 Bytes
Contents
require 'open-uri' require 'nokogiri' module AtpScraper # Get and parse html from atpworldtour.com class Html BASE = "http://www.atpworldtour.com" def self.get(uri) charset = nil html = open(BASE + uri) do |f| charset = f.charset f.read end { html: html, charset: charset } end def self.parse(html, charset) Nokogiri::HTML.parse(html, nil, charset) end end end
Version data entries
9 entries across 9 versions & 1 rubygems