Skip to content

Instantly share code, notes, and snippets.

@ncoblentz
Created November 22, 2011 22:23
Show Gist options
  • Save ncoblentz/1387229 to your computer and use it in GitHub Desktop.
Save ncoblentz/1387229 to your computer and use it in GitHub Desktop.
url='http://www.google.com'
browser.goto(url)
browser.execute_script(%q|var el = document.createElement("script");el.setAttribute("src","http://code.jquery.com/jquery-1.6.4.min.js");document.body.appendChild(el);|)
browser.execute_script(%q|var geturl = $.ajax({type: GET,url: '|+url+%q|',complete: function () {$('body').data('httpheaders_complete',true);},success: function (data,status,xhr) {$('body').data('httpheaders',geturl.getAllResponseHeaders());$('body').data('content',data);}});|)
browser.wait_until { browser.execute_script(%q|return $('body').data('httpheaders_complete');|) }
browser.execute_script(%q|return $('body').data('httpheaders');|)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment