lundi 21 novembre 2016

Ruby-on-Rails. block in find': Unable to find field "q" (Capybara::ElementNotFound)

GitHub project: http://ift.tt/20rNrL3

I'm a beginner, trying to execute this Ruby script.

  1. I created a database.yml file.
  2. I ran the setup file in the bin folder which installed dependenceis via bundle install and set up a database i am assuming via the commands: rake db:create rake db:migrate
  3. so i ran the following: ./bin/rails server

Created an account, filled out the "Job" and "location" and set the amount of pages to check to "1" for indeed.com.

This is the error that i have received:

Started GET "/search?utf8=%E2%9C%93&title=Engineer&location=CA&pages=10&indeed_scraper=1&commit=Find+Jobs" for 127.0.0.1 at 2016-11-19 21:00:26 -0800 Processing by JobsController#search as HTML Parameters: {"utf8"=>"✓", "title"=>"Engineer", "location"=>"CA", "pages"=>"10", "indeed_scraper"=>"1", "commit"=>"Find Jobs"} User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]] Running via Spring preloader in process 2763 /var/lib/gems/2.3.0/gems/capybara-2.7.0/lib/capybara/node/finders.rb:44:in block in find': Unable to find field "q" (Capybara::ElementNotFound) from /var/lib/gems/2.3.0/gems/capybara-2.7.0/lib/capybara/node/base.rb:85:insynchronize' from /var/lib/gems/2.3.0/gems/capybara-2.7.0/lib/capybara/node/finders.rb:33:in find' from /var/lib/gems/2.3.0/gems/capybara-2.7.0/lib/capybara/node/actions.rb:59:infill_in' from /var/lib/gems/2.3.0/gems/capybara-2.7.0/lib/capybara/session.rb:699:in block (2 levels) in <class:Session>' from /var/lib/gems/2.3.0/gems/capybara-2.7.0/lib/capybara/dsl.rb:52:inblock (2 levels) in module:DSL' from scraper.rb:138:in perform_search' from scraper.rb:33:inscrape' from scraper.rb:145:in <top (required)>' from /var/lib/gems/2.3.0/gems/railties-4.2.5.1/lib/rails/commands/runner.rb:60:inload' from /var/lib/gems/2.3.0/gems/railties-4.2.5.1/lib/rails/commands/runner.rb:60:in <top (required)>' from /var/lib/gems/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:inrequire' from /var/lib/gems/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in block in require' from /var/lib/gems/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:240:inload_dependency' from /var/lib/gems/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in require' from /var/lib/gems/2.3.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:123:inrequire_command!' from /var/lib/gems/2.3.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:90:in runner' from /var/lib/gems/2.3.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:39:inrun_command!' from /var/lib/gems/2.3.0/gems/railties-4.2.5.1/lib/rails/commands.rb:17:in <top (required)>' from /var/lib/gems/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:inrequire' from /var/lib/gems/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in block in require' from /var/lib/gems/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:240:inload_dependency' from /var/lib/gems/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in require' from /home/shap/Desktop/job-hunter-master/bin/rails:9:in<top (required)>' from /var/lib/gems/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in load' from /var/lib/gems/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:inblock in load' from /var/lib/gems/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:240:in load_dependency' from /var/lib/gems/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:inload' from /usr/local/lib/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' from /usr/local/lib/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from -e:1:in

' Redirected to http://localhost:3000/users/jobs Completed 302 Found in 8221ms (ActiveRecord: 0.2ms)`

What is going on here?

Aucun commentaire:

Enregistrer un commentaire