Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Dec 29th, 2010  |  syntax: None  |  size: 0.30 KB  |  views: 22  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.     a = []
  2.     document.xpath("//script").each do |elem|
  3.       a << elem.text
  4.     end
  5.     # remove all text
  6.     document.xpath("//text()").remove()
  7.     # restore script text
  8.     i = 0
  9.     document.xpath("//script").each do |elem|
  10.       elem.content = a[i] # restore script texts
  11.       i += 1
  12.     end
clone this paste RAW Paste Data