新手问题 wombat 运行后怎么样才能看到结果呢?

gsky · 2014年07月13日 · 最后由 alixiaomiao 回复于 2014年07月14日 · 1840 次阅读

我拷贝了 wombat 官网的例子:


require 'wombat'

Wombat.crawl do
  base_url "http://www.github.com"
  path "/"

  headline xpath: "//h1"
  subheading css: "p.subheading"

  what_is({ css: ".teaser h3" }, :list)

  links do
explore xpath: '//*[@class="wrapper"]/div[1]/div[1]/div[2]/ul/li[1]/a' do |e|
      e.gsub(/Explore/, "Love")
    end

    search css: '.search'
    features css: '.features'
    blog css: '.blog'

  end

end

官网的预期结果是:

可是我在终端运行后,什么都没有显示,也没找到新生成里文件神马的。。求解惑,要怎么样才能看到 wombat 运行的结果呢?

求助啊T_T

irb 或 pry 里运行试试,上面说只是 return hash,你没有输出当然就不会显示了。

需要 登录 后方可回复, 如果你还没有账号请 注册新账号