Class: Scraper
- Inherits:
-
Object
- Object
- Scraper
- Defined in:
- lib/myfitnesspal_stats/scraper.rb
Instance Method Summary collapse
-
#get_date(year = @date.year, month = @date.month, day = @date.day) ⇒ Object
—- initialize.
-
#initialize(username, password) ⇒ Scraper
constructor
A new instance of Scraper.
Constructor Details
#initialize(username, password) ⇒ Scraper
Returns a new instance of Scraper.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/myfitnesspal_stats/scraper.rb', line 6 def initialize(username, password) @username = username @password = password @date = Date.today @account = Account.new(username, password) @login_page = @account.login @web_crawler = Mechanize.new do |web_crawler| web_crawler..load('cookies.yml') web_crawler. = true end end |