Ar Chron wrote:
> -1 for effort on the part of the poster...
> 
> Please go read 
> http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/classes/Net/HTTP.html
> 
> and learn about what you are trying to use

I learned about 'net/http' and 'hpricot. but it is showing the same 
error even for youtube. The code snippet i used for url extraction is:

require 'rubygems'
require 'hpricot'
require 'open-uri'
require 'dbi'

class Url
    def valid
        begin
        puts "Enter domain name :"
        domain = gets.chomp
        #concatinating 'http://www.' with the url to open the page
        url = "http://#{domain}";
        document = open(url,"User-Agent"=>"Mozilla/4.0 (compatible; MSIE 
5.5; Windows NT 5.0; .NET CLR 1.0.3705)")
        #getting the original url of the site
        realUrl = document.base_uri.to_s
        rescue
            puts "Unable to open the URL. Please check if you have 
entered a valid URL."
        end
        parms = Array.new
        parms = [domain, realUrl]
end

I'm able to extract the data from every site except 
'http://www.youtube.com' and 'gmail.com' and other 'https' sites'. 
Please help. I'll be really thankful

Regards
Arun Kumar
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to