Skip to content

Instantly share code, notes, and snippets.

@barancev
Created July 19, 2020 08:37
Show Gist options
  • Save barancev/7d3e372258ff13e261a98b08a8a5eac4 to your computer and use it in GitHub Desktop.
Save barancev/7d3e372258ff13e261a98b08a8a5eac4 to your computer and use it in GitHub Desktop.
In [8]: driver = webdriver.Chrome()
DevTools listening on ws://127.0.0.1:56562/devtools/browser/fa154d4d-d612-4a2d-8f8d-9f72b58ddaa3
In [9]: driver.get("http://jsbin.com/")
In [10]: driver.switch_to.frame(driver.find_element_by_css_selector("#live iframe"))
In [11]: driver.switch_to.frame(driver.find_element_by_css_selector("iframe"))
In [12]: driver.page_source
Out[12]: '<html><head><script>(function(){window.__blocked={methods:["open","print","alert","prompt","confirm"],old:{}};for(var m in __blocked.methods){try {__blocked.old[m]=window[m];window[m]=function(){};}catch(e){}}})()</script>\n\n\n\n <meta charset="utf-8">\n <meta name="viewport" content="width=device-width">\n <title>JS Bin</title>\n<style id="jsbin-css">\n\n</style>\n</head>\n<body>\n\n\n\n<!--jsbin live harness--><script>(function(){for(var m in __blocked.methods){try{window[m]=__blocked.old[m];delete __blocked;}catch(e){}};})()</script></body></html>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment