module Skh
新光醫療財團法人新光吳火獅紀念醫院
Public Class Methods
crawl()
click to toggle source
# File lib/module/skh.rb, line 3 def Skh.crawl hash = {} url = "https://regis.skh.org.tw/ERONLINE/INDEX.aspx" begin page = Nokogiri::HTML(open(url)) hash[:hospital] = "skh" hash[:wait_internal_medicine] = page.css("#L_TOT2").text.strip hash[:wait_surgery] = page.css("#L_TOT1").text.strip hash[:wait_paediatrics] = page.css("#L_TOT3").text.strip hash[:wait_push_bed] = page.css("#L_TOT7").text.strip hash[:wait_bed] = page.css("#L_TOT5").text.strip hash[:wait_icu] = page.css("#L_TOT6").text.strip rescue Exception => e p e.message return nil end return hash end