-
Notifications
You must be signed in to change notification settings - Fork 67
Description
Trying to use the new skimr rewrite, and I tried use one of the old scrubyt examples, not knowing that things aren't the same way anymore. Spent a long time debugging, just to find out that the nil object error was insignificant, and that I was passing a block to a nonexistent function. The traceback and error did not show the name of the function I was calling
The following code generated the following traceback:
@extractor = Scrubyt::Extractor.new do
fetch 'http://theninthcut.com/anime'
record do # Could also be "doesntExist do", for the same results.
year '2010'
item_name 'Okamikakushi'
end
next_page 'next >>'
end
NoMethodError: You have a nil object when you didn't expect it!
The error occurred while evaluating nil.sub
from /home/nilbus/git/theninthcut/vendor/plugins/scrubyt-skimr/lib/scrubyt/results_extraction.rb:292:in clean_xpath' from /home/nilbus/git/theninthcut/vendor/plugins/scrubyt-skimr/lib/scrubyt/results_extraction.rb:122:inevaluate_xpath'
from /home/nilbus/git/theninthcut/vendor/plugins/scrubyt-skimr/lib/scrubyt/results_extraction.rb:160:in extract_detail' from /home/nilbus/git/theninthcut/vendor/plugins/scrubyt-skimr/lib/scrubyt/results_extraction.rb:159:inmap'
from /home/nilbus/git/theninthcut/vendor/plugins/scrubyt-skimr/lib/scrubyt/results_extraction.rb:159:in extract_detail' from /home/nilbus/git/theninthcut/vendor/plugins/scrubyt-skimr/lib/scrubyt/extractor.rb:60:inmethod_missing'
from (irb):5:in boom' from /home/nilbus/git/theninthcut/vendor/plugins/scrubyt-skimr/lib/scrubyt/extractor.rb:41:ininstance_eval'
from /home/nilbus/git/theninthcut/vendor/plugins/scrubyt-skimr/lib/scrubyt/extractor.rb:41:in initialize' from (irb):3:innew'
from (irb):3:in `boom'
from (irb):12