Sha256: ca016c688e8cdb3b61703e892cb54fa7425d1078cb1775dbd017be0cfb2cd0fd
Contents?: true
Size: 903 Bytes
Versions: 3
Compression:
Stored size: 903 Bytes
Contents
# -*- coding: utf-8 -*- # # amileage.rb: mileage by scraping www.ana.co.jp. for PointsScraper # # Copyright (C) 2012 by MATSUI Shinsuke <poppen.jp@gmail.com> # Distributed under GPL. # require 'points-scraper/default' module Points::Scraper class AnaMileage < Default URL = 'https://www.ana.co.jp/' 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.click_button end agent.page.forms[0].tap do|form| form.encoding = 'CP932' form.click_button end agent.page.at('//div[@class="mileInfo_a2"]//span[1]').text end end end end # Local Variables: # mode: ruby # indent-tabs-mode: t # tab-width: 3 # ruby-indent-level: 3 # End: # vim: ts=3
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
points-scraper-0.1.2 | lib/points-scraper/anamileage.rb |
points-scraper-0.1.1 | lib/points-scraper/anamileage.rb |
points-scraper-0.1.0 | lib/points-scraper/anamileage.rb |