Method: Compactor::Amazon::ScrapedRow#download_report

Defined in:
lib/compactor/scraped_row.rb

#download_reportObject



28
29
30
31
32
33
34
35
36
37
# File 'lib/compactor/scraped_row.rb', line 28

def download_report
  buttons           = report_buttons
  button_index      = index_of_button(buttons)
  report_url        = buttons[button_index].node["href"]
  report_identifier = buttons[button_index].node.search(".button_label").text
  type              = ReportScraper.report_type(report_identifier)
  response_body     = @mechanize.get(report_url).body

  [type, response_body]
end