Class: Points::Scraper::AnaMileage
- Defined in:
- lib/points-scraper/anamileage.rb
Constant Summary collapse
- URL =
'https://www.ana.co.jp/'
Instance Method Summary collapse
Methods inherited from Default
Constructor Details
This class inherits a constructor from Points::Scraper::Default
Instance Method Details
#start ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/points-scraper/anamileage.rb', line 15 def start start_scrape do |agent| agent = Mechanize::new agent.set_proxy( *ENV['HTTP_PROXY'].split( /:/ ) ) if ENV['HTTP_PROXY'] agent.get(URL) agent.page.form_with(:name => 'loginForm') do|form| form.custno = @user form.password = @pass form. end agent.page.forms[0].tap do|form| form.encoding = 'CP932' form. end agent.page.at('ul.point-list a').text.gsub(/,/, '') end end |