def save_current_page(options = {})
        default_options = {:replacement => true}
        options = default_options.merge(options)
        to_dir = options[:dir] || default_dump_dir

        if options[:filename]
          file_name = options[:filename]
        else
          file_name = Time.now.strftime("%m%d%H%M%S") + ".html"
        end

        Dir.mkdir(to_dir) unless File.exists?(to_dir)
        file = File.join(to_dir, file_name)

        content = page_source
        base_url = @web_browser.context.base_url
        current_url = @web_browser.url
        current_url =~ /(.*\/).*$/
        current_url_parent = $1
        if options[:replacement] && base_url =~ /^http:/
          File.new(file, "w").puts absolutize_page_hpricot(content, base_url, current_url_parent)
        else
          File.new(file, "w").puts content
        end

      end
def save_current_page(options = {})
        default_options = {:replacement => true}
        options = default_options.merge(options)
        to_dir = options[:dir] || default_dump_dir

        if options[:filename]
          file_name = options[:filename]
        else
          file_name = Time.now.strftime("%m%d%H%M%S") + ".html"
        end

        Dir.mkdir(to_dir) unless File.exists?(to_dir)
        file = File.join(to_dir, file_name)

        content = page_source
        base_url = @web_browser.context.base_url
        current_url = @web_browser.url
        current_url =~ /(.*\/).*$/
        current_url_parent = $1
        if options[:replacement] && base_url =~ /^http:/
          File.new(file, "w").puts absolutize_page_hpricot(content, base_url, current_url_parent)
        else
          File.new(file, "w").puts content
        end

      end
For current page souce to a file in specified folder for inspection

   save_current_page(:dir => "C:\\mysite", filename => "abc", :replacement => true)