Module: Scmh
- Defined in:
- lib/module/scmh.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 20 21 |
# File 'lib/module/scmh.rb', line 3 def Scmh.crawl hash = {} url = "http://www.scmh.org.tw/" begin html = open(url).read html.encode!("big5") page = Nokogiri::HTML.parse html hash[:hospital] = "scmh" # hash[:to_119] = page.css("").text.strip hash[:wait_see] = page.css("#aspnetForm table tr:nth-child(6) td table tr td.map table tr td:nth-child(1) table:nth-child(2) tr td div.TVtext table tr:nth-child(1) td:nth-child(2)").text.strip hash[:wait_push_bed] = page.css("#ctl00_ContentPlaceHolder1_ERTVView_min_LabelBN").text.strip hash[:wait_bed] = page.css("#ctl00_ContentPlaceHolder1_ERTVView_min_LabelHN").text.strip hash[:wait_cure_bed] = page.css("#ctl00_ContentPlaceHolder1_ERTVView_min_LabelICN").text.strip rescue Exception => e p e. return nil end return hash end |