Module: Kmuh
- Defined in:
- lib/module/kmuh.rb
Overview
高雄醫學大學附設中和紀念醫院
Class Method Summary collapse
Class Method Details
.crawl ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/module/kmuh.rb', line 3 def Kmuh.crawl hash = {} url = "http://www.kmuh.org.tw/KMUHWeb/Pages/P04MedService/ERStatus.aspx" begin page = Nokogiri::HTML(open(url)) hash[:hospital] = "kmuh" hash[:to_119] = page.css("#Label_A01").text.strip hash[:wait_see] = page.css("#Label_A02").text.strip hash[:wait_push_bed] = page.css("#Label_A03").text.strip hash[:wait_bed] = page.css("#Label_A04").text.strip hash[:wait_cure_bed] = page.css("#Label_A05").text.strip rescue Exception => e p e. return nil end return hash end |