Class: Maimailog::Crawler::Base
- Inherits:
-
Object
- Object
- Maimailog::Crawler::Base
- Defined in:
- lib/maimailog/crawler/base.rb
Instance Method Summary collapse
-
#initialize ⇒ Base
constructor
A new instance of Base.
-
#login(id, password) ⇒ Object
maimainet にログインを試みる 成功したら home 画面ページが返る.
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
5 6 7 |
# File 'lib/maimailog/crawler/base.rb', line 5 def initialize @agent = Mechanize.new end |
Instance Method Details
#login(id, password) ⇒ Object
maimainet にログインを試みる成功したら home 画面ページが返る
12 13 14 15 16 17 18 19 |
# File 'lib/maimailog/crawler/base.rb', line 12 def login(id, password) page = @agent.get('https://maimai-net.com/maimai-mobile/login.html') form = page.forms[0] form.segaid = id form.passwd = password = form.(value: 'Sid Login') @agent.submit(form, ) end |