Class: Undead::Agent
- Inherits:
-
Object
- Object
- Undead::Agent
- Defined in:
- lib/undead/agent.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ js_errors: false, timeout: 1000, headers: { 'User-Agent' => "Mozilla/5.0 (Macintosh; Intel Mac OS X)" }, }
Instance Method Summary collapse
- #get(url) ⇒ Object
-
#initialize(options = {}) ⇒ Agent
constructor
A new instance of Agent.
Constructor Details
#initialize(options = {}) ⇒ Agent
Returns a new instance of Agent.
13 14 15 |
# File 'lib/undead/agent.rb', line 13 def initialize( = {}) @session = Driver.new(DEFAULT_OPTIONS.merge()) end |
Instance Method Details
#get(url) ⇒ Object
17 18 19 20 |
# File 'lib/undead/agent.rb', line 17 def get(url) @session.visit url @session.html end |