Class: AmazonDeets::MechanizedFragment

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

Overview

Amazon renders different HTML dependending upon the type of product that you are viewing. This means that the scraper queries need to change depending upon whether you want the data for a Kindle book or some general merchandise. Rather than building one super-complicated scraper, we’ll break the code into multiple simple scrapers that focus on solving specific problems.

Direct Known Subclasses

GeneralMerchandiseFragment, KindleFragment

Instance Method Summary collapse

Instance Method Details

#applicable?(agent) ⇒ Boolean

Decides whether or not this MechanizedFragment is applicable

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


55
56
57
# File 'lib/amazon_deets/core.rb', line 55

def applicable?(agent)
  raise NotImplementedError
end

#scrape(agent) ⇒ Object

Raises:

  • (NotImplementedError)


59
60
61
# File 'lib/amazon_deets/core.rb', line 59

def scrape(agent)
  raise NotImplementedError
end