Class: Points::Scraper::TPoint

Inherits:
Default
  • Object
show all
Defined in:
lib/points-scraper/tpoint.rb

Constant Summary collapse

URL =
'https://tsite.jp'

Instance Method Summary collapse

Methods inherited from Default

#initialize

Constructor Details

This class inherits a constructor from Points::Scraper::Default

Instance Method Details

#startObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/points-scraper/tpoint.rb', line 15

def start
	start_scrape do |agent|
		agent.open_timeout = 3

		agent.get( URL + '/tm/pc/login/STKIp0001001.do' )

		agent.page.form_with( :name => 'form1' ) do |form|
			form.action = URL + '/tm/pc/login/STKIp0001010.do'
			form['LOGIN_ID'] = @user
			form['PASSWORD'] = @pass
			form.click_button
		end

		agent.page.at( 'p.point > span.number' ).text
	end
end