Ok, so the issue here is with SSL: 

OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read 
server certificate B: certificate verify failed

The script below:

require 'nokogiri'
require 'open-uri'
url = 'http://www.google.com'
doc = Nokogiri::HTML(open(url))
puts doc.at_css("title").text


Works for non HTTPS pages. How can I force SSL/TSL? I was reading this 
solution: https://gist.github.com/fnichol/867550 but there are two issues 
a) This does not work for me b) I am not using Rails

Any ideas??

I read this post from here: 
On Tuesday, 20 August 2013 11:38:29 UTC-6, Bashir Osman wrote:
>
> Hi, 
>
> I read this post here: http://zeljkofilipin.com/watir-nokogiri/
>
> Just curious does anyone know how to ONLY parse the DOM using Nokogiri 
> then using Watir to automate the DOM? 
>
> This is what I'm currently doing, but its giving me SSL errors. So i'm 
> most likely doing something very wrong. I'm currently using Ruby 2.0
>
> require 'rspec'
> require 'watir'
> require 'watir-webdriver'
> require 'nokogiri'
> require 'open-uri'
>   before(:each) do
>     url = @browser.url
>     puts "this is the #{url}"
>     doc = Nokogiri::HTML(open(url))
>     puts doc.at_css("title").text
>   end
>
> This does work though: 
>
> require 'nokogiri'
> require 'open-uri'
> url = 'http://www.google.com'
> doc = Nokogiri::HTML(open(url))
> puts doc.at_css("title").text
>

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to