WordPress websites: undefined method `search' for nil:NilClass (NoMethodError) #16

Closed
vatnoise opened this Issue Mar 1, 2016 · 3 comments

Projects

None yet

2 participants

@vatnoise
vatnoise commented Mar 1, 2016

Hi,
I'm using Ruby Gems for the first time and might be just doing some newbie mistakes.
Am I right that I can use this get to test any website on the web?

I've tried to test a few websites and it seems that when it's a WordPress website it gives me an error:

/Library/Ruby/Gems/2.0.0/gems/validate-website-1.5.4/lib/validate_website/crawl.rb:36:in `extract_imgs_from_page': undefined method `search' for nil:NilClass (NoMethodError)
from /Library/Ruby/Gems/2.0.0/gems/validate-website-1.5.4/lib/validate_website/crawl.rb:63:in `block in on_every_html_page'
from /Library/Ruby/Gems/2.0.0/gems/spidr-0.5.0/lib/spidr/agent/events.rb:233:in `block in every_html_page'
from /Library/Ruby/Gems/2.0.0/gems/spidr-0.5.0/lib/spidr/agent.rb:637:in `call'
from /Library/Ruby/Gems/2.0.0/gems/spidr-0.5.0/lib/spidr/agent.rb:637:in `block (2 levels) in visit_page'
from /Library/Ruby/Gems/2.0.0/gems/spidr-0.5.0/lib/spidr/agent.rb:637:in `each'
from /Library/Ruby/Gems/2.0.0/gems/spidr-0.5.0/lib/spidr/agent.rb:637:in `block in visit_page'
from /Library/Ruby/Gems/2.0.0/gems/spidr-0.5.0/lib/spidr/agent.rb:573:in `block in get_page'
from /Library/Ruby/Gems/2.0.0/gems/spidr-0.5.0/lib/spidr/agent.rb:739:in `prepare_request'
from /Library/Ruby/Gems/2.0.0/gems/spidr-0.5.0/lib/spidr/agent.rb:567:in `get_page'
from /Library/Ruby/Gems/2.0.0/gems/spidr-0.5.0/lib/spidr/agent.rb:633:in `visit_page'
from /Library/Ruby/Gems/2.0.0/gems/spidr-0.5.0/lib/spidr/agent.rb:297:in `run'
from /Library/Ruby/Gems/2.0.0/gems/spidr-0.5.0/lib/spidr/agent.rb:279:in `start_at'
from /Library/Ruby/Gems/2.0.0/gems/spidr-0.5.0/lib/spidr/agent.rb:229:in `site'
from /Library/Ruby/Gems/2.0.0/gems/spidr-0.5.0/lib/spidr/spidr.rb:120:in `site'
from /Library/Ruby/Gems/2.0.0/gems/validate-website-1.5.4/lib/validate_website/crawl.rb:44:in `spidr_crawler'
from /Library/Ruby/Gems/2.0.0/gems/validate-website-1.5.4/lib/validate_website/crawl.rb:21:in `crawl'
from /Library/Ruby/Gems/2.0.0/gems/validate-website-1.5.4/lib/validate_website/runner.rb:16:in `run_crawl'
from /Library/Ruby/Gems/2.0.0/gems/validate-website-1.5.4/bin/validate-website:5:in `<top (required)>'
from /usr/local/bin/validate-website:23:in `load'
from /usr/local/bin/validate-website:23:in `<main>'
@vatnoise
vatnoise commented Mar 1, 2016

Even

validate-website -s "http://wordpress.org"

gives this error

@spk
Owner
spk commented Mar 1, 2016

Hi @vatnoise, yes this gem is not only for Ruby websites it should work for any website in The Internet :trollface:
I will take a look on this and keep you informed.

@spk spk self-assigned this Mar 1, 2016
@spk spk added a commit that referenced this issue Mar 2, 2016
@spk Reproduce error with redirect and extract images (see #16) 2dc5053
@spk spk added a commit that closed this issue Mar 2, 2016
@spk Fix undefined method 'search' for nil:NilClass (NoMethodError)
fix #16
54f574a
@spk spk closed this in 54f574a Mar 2, 2016
@spk
Owner
spk commented Mar 2, 2016

Released in validate-website (1.5.6)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment