require 'mechanize'
agent = Mechanize.new
page = agent.get ( 'http://google.com' )
page = agent.page .link_with ( :text => 'News' ) .click
#The error below keeps showing up when I run the code, I don't know why.
=begin C:/Ruby22/lib/ruby/2.2.0/net/http.rb:923:in `connect':
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate
B: certificate verify failed (OpenSSL::SSL::SSLError)
=end
cmVxdWlyZSAnbWVjaGFuaXplJwoKYWdlbnQgPSBNZWNoYW5pemUubmV3CnBhZ2UgPSBhZ2VudC5nZXQoJ2h0dHA6Ly9nb29nbGUuY29tJykKCnBhZ2UgPSBhZ2VudC5wYWdlLmxpbmtfd2l0aCg6dGV4dCA9PiAnTmV3cycpLmNsaWNrCgojVGhlIGVycm9yIGJlbG93IGtlZXBzIHNob3dpbmcgdXAgd2hlbiBJIHJ1biB0aGUgY29kZSwgSSBkb24ndCBrbm93IHdoeS4KCj1iZWdpbiBDOi9SdWJ5MjIvbGliL3J1YnkvMi4yLjAvbmV0L2h0dHAucmI6OTIzOmluIGBjb25uZWN0JzogClNTTF9jb25uZWN0IHJldHVybmVkPTEgZXJybm89MCBzdGF0ZT1TU0x2MyByZWFkIHNlcnZlciBjZXJ0aWZpY2F0ZSAKQjogY2VydGlmaWNhdGUgdmVyaWZ5IGZhaWxlZCAoT3BlblNTTDo6U1NMOjpTU0xFcnJvcikKPWVuZA==