###前提・実現したいこと
rubyでnokogiriを使ってウェブスクレイピングしようとしています。
一通りプログラムは組めたのですが、以下のようなエラーが発生してしまいます。
###発生している問題・エラーメッセージ
18: syntax error, unexpected end-of-input, expecting keyword_end
###該当のソースコード
ruby
1#!/usr/bin/ruby 2require 'mechanize' 3agent = Mechanize.new 4agent.user_agent_alias = 'Windows Mozilla' 5 6url = 'http://www.watashi-move.jp/pc/login.php' 7page = agent.get(url) 8mypage = page.form_with(id: 'form1') do |form| 9form.loginid = '*' 10form.password = '*' 11end.submit 12 13url = 'https://www.watashi-move.jp/wl/mydata/sphygmomanometer.php?targetDate=2016/07/01' 14page = agent.get(url) 15doc = page.root 16doc.xpath('//tr[@class="day13"]/td[@class="pressureMin"]').text 17puts doc.xpath('//tr[@class="day13"]/td[@class="pressureMin"]').text 18end
###試したこと
ネットなどで調べて-wオプションを実行してみたら
8⚠️assigned but unused variable -mypage
mechanize/cookie will be deprecated. please migrate to the http-cookie APIs.
mechanize/cookie_jar will be deprecated.please migrate to the http-cookie APIs.
と出力されました。
調べてみたのですが、よく理解できませんでしたので、
よろしくお願い致します。
###補足情報(言語/FW/ツール等のバージョンなど)
より詳細な情報
下記のような回答は推奨されていません。
このような回答には修正を依頼しましょう。
2016/11/13 23:09
2016/11/13 23:27
2016/11/14 02:16
2016/11/14 08:50
2016/11/15 01:51
2016/11/16 07:29 編集
2016/11/16 06:07