Sha256: 11394902a679d2af424310d6b7764f42fe4c6d81b8eb764115adafd2abd94678

Contents?: true

Size: 403 Bytes

Versions: 1

Compression:

Stored size: 403 Bytes

Contents

require "undead/driver"

module Undead
  class Agent
    DEFAULT_OPTIONS = {
      js_errors: false,
      timeout: 1000,
      headers: {
        'User-Agent' => "Mozilla/5.0 (Macintosh; Intel Mac OS X)"
      },
    }

    def initialize(options = {})
      @session = Driver.new(DEFAULT_OPTIONS.merge(options))
    end

    def get(url)
      @session.visit url
      @session.html
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
undead-0.2.0 lib/undead/agent.rb