Sha256: ac599ec8feb960bd32c8413d8abe24728ec1498cd22a05b992a152195b6513e9

Contents?: true

Size: 400 Bytes

Versions: 1

Compression:

Stored size: 400 Bytes

Contents

require 'nokogiri'
require 'httpclient'

class Maxwell
  module Converter
    def self.execute(url)
      client = HTTPClient.new(default_header: {"User-Agent" => "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"})

      html = begin
        client.get_content(url)
      rescue
        ""
      end

      Nokogiri::HTML(html)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
maxwell-0.1.0 lib/maxwell/converter.rb