Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shared_utils.rb:42:in traverse_for_match': undefined method each' for nil:NilClass (NoMethodError) #4

Open
szTheory opened this issue Nov 10, 2009 · 3 comments

Comments

@szTheory
Copy link

Here is the fix: http://www.hindoogle.com/blog/2009/09/scrubyt-traverse_for_match-nilclass/

Here is the error:

/opt/local/lib/ruby/gems/1.8/gems/scrubyt-0.4.06/lib/scrubyt/utils/shared_utils.rb:42:in traverse_for_match': undefined methodeach' for nil:NilClass (NoMethodError)
from /opt/local/lib/ruby/gems/1.8/gems/scrubyt-0.4.06/lib/scrubyt/utils/shared_utils.rb:42:in call' from /opt/local/lib/ruby/gems/1.8/gems/scrubyt-0.4.06/lib/scrubyt/utils/shared_utils.rb:42:intraverse_for_match'
from /opt/local/lib/ruby/gems/1.8/gems/scrubyt-0.4.06/lib/scrubyt/utils/shared_utils.rb:42:in each' from /opt/local/lib/ruby/gems/1.8/gems/scrubyt-0.4.06/lib/scrubyt/utils/shared_utils.rb:42:intraverse_for_match'
from /opt/local/lib/ruby/gems/1.8/gems/scrubyt-0.4.06/lib/scrubyt/utils/shared_utils.rb:44:in call' from /opt/local/lib/ruby/gems/1.8/gems/scrubyt-0.4.06/lib/scrubyt/utils/shared_utils.rb:44:intraverse_for_match'
from /opt/local/lib/ruby/gems/1.8/gems/scrubyt-0.4.06/lib/scrubyt/utils/simple_example_lookup.rb:36:in find_node_from_text' from /opt/local/lib/ruby/gems/1.8/gems/scrubyt-0.4.06/lib/scrubyt/core/scraping/filters/tree_filter.rb:67:ingenerate_XPath_for_example'
... 7 levels...
from /opt/local/lib/ruby/gems/1.8/gems/scrubyt-0.4.06/lib/scrubyt/core/shared/extractor.rb:75:in initialize' from /opt/local/lib/ruby/gems/1.8/gems/scrubyt-0.4.06/lib/scrubyt/core/shared/extractor.rb:32:innew'
from /opt/local/lib/ruby/gems/1.8/gems/scrubyt-0.4.06/lib/scrubyt/core/shared/extractor.rb:32:in `define'
from my-scraper.rb:11

@latompa
Copy link

latompa commented Feb 11, 2010

I'm getting this error as well

require 'rubygems'
require 'scrubyt'

Scrubyt::Extractor.define do
  fetch "http://john.wordpress.com"
  site_information '//*' do
    is_feed "//feed"
  end
end.to_hash.first

mechanize (0.9.3)
scrubyt (0.4.06)
hpricot (0.8.2)

@tourque3000
Copy link

I vote to get this put into the next release

@fad
Copy link

fad commented Aug 10, 2011

I suddenly got this problem with scripts that had been working before. Solved it by deinstalling a newer version of hpricot I had gotten thus reversing to version 0.6.164.
This http://www.hindoogle.com/blog/index.php?s=rails&sbutt=Go didn't work, but looking into the file I got the idea with hpricot. Also check your installed mechanize versions if you're having problems with scrubyt. Seems to mes they stopped development of it in 2008 and you're stuck with using the old versions of the other libraries now :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants