Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
codeitloadit opened this issue Mar 23, 2023 · 2 comments
Open

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

codeitloadit opened this issue Mar 23, 2023 · 2 comments

Comments

@codeitloadit
Copy link

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

@hritik-m
Copy link

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

@codeitloadit
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@codeitloadit @hritik-m and others