作者forkome (丁丁是个人材)
看板Ruby
标题[问题] scrubyt使用问题 on WindowsXP
时间Mon Apr 28 23:26:46 2008
环境:
JRuby 1.1
状况: [新手上路]
小弟想去截取网页中的资讯,在爬文後
大多数人是使用scrubyt,它还支援POST功能
看了官方的教学安装完後,却出现错误讯息
不知是否在WinXP不相容的问题呢?还是需要对text_filter.rb来做修改?
C:/jruby-1.1/lib/ruby/gems/1.8/gems/scrubyt-0.3.4-java/lib/scrubyt/core/scraping
/filters/text_filter.rb:25 warning: don't put space before argument
parentheses
Exception in thread "main" java.lang.NoSuchMethodError:
org.jruby.runtime.builti
n.IRubyObject.getInstanceVariable(Ljava/lang/String;)Lorg/jruby/runtime/builtin/
IRubyObject;
Source Code如下
require 'rubygems'
require 'scrubyt'
google_data = Scrubyt::Extractor.define do
#Perform the action(s)
fetch '
http://www.google.com/ncr'
fill_textfield 'q', 'ruby'
submit
#Construct the wrapper
link "Ruby Programming Language" do
url "href", :type => :attribute
end
next_page "Next", :limit => 2
end
puts google_data.to_xml
附录:
官方网站
http://scrubyt.org/
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 59.116.35.78