browserstack / api

Spec of latest BrowserStack JavaScript testing api

Home Page:https://www.browserstack.com/javascript-testing-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there a way to get the rendered dom/html?

codeitloadit opened this issue · comments

commented

I am looking to get the html source of the page after JavaScript has rendered a dynamic page.

from time import sleep # this should go at the top of the file

sleep(5)
html = driver.execute_script("return document.getElementsByTagName('html')[0].innerHTML")
print html

commented

from time import sleep # this should go at the top of the file

sleep(5) html = driver.execute_script("return document.getElementsByTagName('html')[0].innerHTML") print html

I am working in the context of a browser worker that has been created as described in the readme. I am looking for the text/html equivalent of
curl -u "username:access_key" https://api.browserstack.com/5/worker/123456789/screenshot.json