http://rubyist.g.hatena.ne.jp/oquno/20090802/1249244198
これの解決編
page=agent.get(url) content=page.search('.hehehe') p content[0]
としていたところを
require "nokogiri" とかを追加しつつ
def fixpage(page) return Nokogiri(page.content.toutf8) end page=agent.get(url) page=fixpage(page) content=page.search('.hehehe') p content[0]
某ページを取得するのに
page=agent.get(url) content=page.search('.hehehe') p content[0]
みたいにして
<dt class="hehehe"> <span><a href="/hoge">hoge①</a></span> <span>huga</span> </dt>
と出てほしいのだけど
<dt class="hehehe"> <span><a href="/hoge">hoge</a></span> </dt>
と出た。困りましたね。
を書いて Mac では動いたんだけど定期的に動かしたい Ubuntu サーバーで エラーが出るので誰か教えてください。
Ubuntu のエラー
/usr/local/lib/ruby/gems/1.9.1/gems/sqlite3-ruby-1.2.4/lib/sqlite3/database.rb:621:in `load_driver': no driver for sqlite3 found (RuntimeError)
$LOAD_PATHとかは違うっぽい
oquno2009/07/05 19:46諦めて1.8.6にダウングレードしてみる作戦