class Points::Scraper::Rakuten

Constants

URL

Public Instance Methods

start() click to toggle source
# File lib/points-scraper/rakuten.rb, line 15
def start
        start_scrape do |agent|
                agent = Mechanize::new
                agent.set_proxy( *ENV['HTTP_PROXY'].split( /:/ ) ) if ENV['HTTP_PROXY']

                page = agent.get(URL)

                login_page = agent.click( page.link_with(:href => /login/i) )
                point_page = login_page.form_with(:name => 'LoginForm') do|form|
                        form.u = @user
                        form.p = @pass
                end.click_button

                point_page.at('//div[@id="pointAccount"]//dl[@class="total"]/dd').text
        end
end