在 ubuntu 执行 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: '//*[@id="wrapper"]/div[1]/div/ul/li[1]/a' do |e| e.gsub(/Explore/, "Love") end
search css: '.search' features css: '.features' blog css: '.blog' end end
结果报
按照http://stackoverflow.com/questions/13303113/undefined-method-gsub-for-nilnilclass-nomethoderror 里说的方法,在 e.gsub 前面加了一个判空也一样报错,有哪位能帮忙分析下原因吗? :)