Hi, Is there any way to extract the html code of a https:// website in hpricot. When i use hpricot to access a https:// website i receive the following error. /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'': no such file to load -- net/https (LoadError) from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'' from /usr/lib/ruby/1.8/open-uri.rb:230:in `open_http'' from /usr/lib/ruby/1.8/open-uri.rb:616:in `buffer_open'' from /usr/lib/ruby/1.8/open-uri.rb:164:in `open_loop'' from /usr/lib/ruby/1.8/open-uri.rb:162:in `catch'' from /usr/lib/ruby/1.8/open-uri.rb:162:in `open_loop'' from /usr/lib/ruby/1.8/open-uri.rb:132:in `open_uri'' from /usr/lib/ruby/1.8/open-uri.rb:518:in `open'' from /usr/lib/ruby/1.8/open-uri.rb:30:in `open'' from demo.rb:15:in `valid'' from demo.rb:93 I''m also not able to load the html data gmail, youtube etc. Is it because i''m using hpricot. Is there any other way to extract https websites. Please help me. Regards Arun Kumar Attachments: http://www.ruby-forum.com/attachment/3452/demo.rb -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Did you require ''net/https''? It seems that that lib is just not loaded/ present. On Mar 17, 1:05 pm, Arun Kumar <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi, > Is there any way to extract the html code of a https:// website in > hpricot. When i use hpricot to access a https:// website i receive the > following error. > > /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in > `gem_original_require'': no such file to load -- net/https (LoadError) > from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in > `require'' > from /usr/lib/ruby/1.8/open-uri.rb:230:in `open_http'' > from /usr/lib/ruby/1.8/open-uri.rb:616:in `buffer_open'' > from /usr/lib/ruby/1.8/open-uri.rb:164:in `open_loop'' > from /usr/lib/ruby/1.8/open-uri.rb:162:in `catch'' > from /usr/lib/ruby/1.8/open-uri.rb:162:in `open_loop'' > from /usr/lib/ruby/1.8/open-uri.rb:132:in `open_uri'' > from /usr/lib/ruby/1.8/open-uri.rb:518:in `open'' > from /usr/lib/ruby/1.8/open-uri.rb:30:in `open'' > from demo.rb:15:in `valid'' > from demo.rb:93 > > I''m also not able to load the html data gmail, youtube etc. Is it > because i''m using hpricot. Is there any other way to extract https > websites. Please help me. > > Regards > Arun Kumar > > Attachments:http://www.ruby-forum.com/attachment/3452/demo.rb > > -- > Posted viahttp://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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Harm wrote:> Did you require ''net/https''? It seems that that lib is just not loaded/ > present. > > On Mar 17, 1:05�pm, Arun Kumar <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>Can u please explain about how to include ''net/https''. Thanks a lot -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
-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 -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 useI 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> Please help. I''ll be really thankful > > Regards > Arun KumarA quick Google search for ''rails https'' yielded this on the 5th entry found. It seems like exactly what you need to do. http://railsruby.blogspot.com/2006/02/https-open-uri-basic-authentication.html -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Mar 17, 2:37 pm, Ar Chron <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Please help. I''ll be really thankful > > > Regards > > Arun Kumar > > A quick Google search for ''rails https'' yielded this on the 5th entry > found. It seems like exactly what you need to do. > > http://railsruby.blogspot.com/2006/02/https-open-uri-basic-authentica...It also looks completely out of date - that patch doesn''t look like it would apply to current versions of ruby 1.8.6 if net/https can''t be required then I would assumed this is on a linux distribution where ruby is split into multiple packages, one of which is usually this one with ssl stuff in it ( libopenssl-ruby in ubuntu) Fred> -- > Posted viahttp://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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> On Mar 17, 2:37�pm, Ar Chron <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> > Please help. I''ll be really thankful >> >> > Regards >> > Arun Kumar >> >> A quick Google search for ''rails https'' yielded this on the 5th entry >> found. It seems like exactly what you need to do. >> >> http://railsruby.blogspot.com/2006/02/https-open-uri-basic-authentica... > > It also looks completely out of date - that patch doesn''t look like it > would apply to current versions of ruby 1.8.6 > if net/https can''t be required then I would assumed this is on a linux > distribution where ruby is split into multiple packages, one of which > is usually this one with ssl stuff in it ( libopenssl-ruby in ubuntu) > > > FredYes i think like that. As a fresher to ruby, i didn''t understand a bit of the code and as u said looks outdated. If u have any tricks in the trade to parse html content from atleast this site. http://www.youtube.com'' i''m receiving an error like this while extracting data from the site : `open_http'': 400 Bad Request (OpenURI::HTTPError) This is not the error which is displayed in the case of ''https://'' sites. Please help 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---