Ruby 调用 IE 解析页面,并获取解析结果

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

require 'win32ole'

web_browser = WIN32OLE.new('InternetExplorer.Application')
web_browser.visible = true
web_browser.navigate('http://www.oschina.net/')

while web_browser.ReadyState != 4
  sleep 1
end

puts web_browser.document.getElementById('header').innerHtml.length

puts "Page is loaded"