[Ruby]取得網頁資料
require "net/http"
 
reponse = Net::HTTP.get_response('www.oreilly.com','/about/')
 
#列印網頁所傳回的代碼並以數字輸出:
print response.code.to_i
 
#列印網頁內容:
print response.body
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License