Grabbing the Contents of a Web Page.rb : HTTP Reponse « Network « Ruby






Grabbing the Contents of a Web Page.rb

require 'open-uri'
puts open('http://www.oreilly.com/').read(200)

 








Related examples in the same category

1.Checking for Errors and Redirects
2.Get response encoding and body
3.Get url and response
4.Get response code
5.get server information from the response
6.Each key in the response
7.For each segment received
8.Zip header
9.Read mysql command output
10.Read a web page