def absolutize_page_hpricot(content, base_url, parent_url)
      return absolutize_page(content, base_url, parent_url) if RUBY_PLATFORM == 'java'
      begin
        require 'hpricot'
        doc = Hpricot(content)
        base_url.slice!(-1) if ends_with?(base_url, "/")
        (doc/'link').each { |e| e['href'] = absolutify_url(e['href'], base_url, parent_url) || "" }
        (doc/'img').each { |e| e['src'] = absolutify_url(e['src'], base_url, parent_url) || "" }
        (doc/'script').each { |e| e['src'] = absolutify_url(e['src'], base_url, parent_url) || "" }
        return doc.to_html
      rescue => e
        absolutize_page(content, base_url, parent_url)
      end
    end
def absolutize_page_hpricot(content, base_url, parent_url)
      return absolutize_page(content, base_url, parent_url) if RUBY_PLATFORM == 'java'
      begin
        require 'hpricot'
        doc = Hpricot(content)
        base_url.slice!(-1) if ends_with?(base_url, "/")
        (doc/'link').each { |e| e['href'] = absolutify_url(e['href'], base_url, parent_url) || "" }
        (doc/'img').each { |e| e['src'] = absolutify_url(e['src'], base_url, parent_url) || "" }
        (doc/'script').each { |e| e['src'] = absolutify_url(e['src'], base_url, parent_url) || "" }
        return doc.to_html
      rescue => e
        absolutize_page(content, base_url, parent_url)
      end
    end
absolutize_page using hpricot