fork download
  1. require 'mechanize'
  2.  
  3. agent = Mechanize.new
  4. page = agent.get('http://google.com')
  5.  
  6. page = agent.page.link_with(:text => 'News').click
  7.  
  8. #The error below keeps showing up when I run the code, I don't know why.
  9.  
  10. =begin C:/Ruby22/lib/ruby/2.2.0/net/http.rb:923:in `connect':
  11. SSL_connect returned=1 errno=0 state=SSLv3 read server certificate
  12. B: certificate verify failed (OpenSSL::SSL::SSLError)
  13. =end
Runtime error #stdin #stdout #stderr 0.05s 9784KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
/usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- mechanize (LoadError)
	from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from prog.rb:1:in `<main>'