def code_me
      html = browser.get_html_source
      filename = "#{Rails.root.join('tmp')}/pyrite-#{Time.now.to_i}.html"
      code = File.open(filename, 'w') { |f| f.write(html) }
      puts `open #{code}`
    end
def code_me
      html = browser.get_html_source
      filename = "#{Rails.root.join('tmp')}/pyrite-#{Time.now.to_i}.html"
      code = File.open(filename, 'w') { |f| f.write(html) }
      puts `open #{code}`
    end
Write the HTML of a page to a file and open it.
 (probably only works on OS X)