Skip to content

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

@szTheory

Description

@szTheory

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions