Class: AmazonDeets::MechanizedContext

Inherits:
Object
  • Object
show all
Defined in:
lib/amazon_deets/core.rb

Overview

A MechanizedContext is similar to a scraper, but it assumes that the @agent has already navigated to the URL that is going to be scraped.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(agent: Mechanized.new) ⇒ MechanizedContext

Returns a new instance of MechanizedContext.



73
74
75
# File 'lib/amazon_deets/core.rb', line 73

def initialize(agent: Mechanized.new)
  @agent = agent
end

Instance Attribute Details

#agentObject

Returns the value of attribute agent.



71
72
73
# File 'lib/amazon_deets/core.rb', line 71

def agent
  @agent
end

Instance Method Details

#scrapeObject

Raises:

  • (NotImplementedError)


78
79
80
# File 'lib/amazon_deets/core.rb', line 78

def scrape
  raise NotImplementedError
end