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 it possible to get the DOM object of the URL/webpage which i'm testing it, through the webpage test API? #28

Open
sathiyaka opened this issue Nov 12, 2014 · 3 comments

Comments

@sathiyaka
Copy link

No description provided.

@pmeenan
Copy link
Contributor

pmeenan commented Nov 12, 2014

What do you mean by "the DOM object"? Which one and how do you want to "get" it (serialized as JSON)?

You could use a custom metric that runs after the test to extract whatever you want from the page and return it (available as --custom through the API).

@sathiyaka
Copy link
Author

I have a node.js program and i'm passing a URL (eg: www.google.com) to wpt.runTest method. once the test completes , I would like to get the entire view source of the page. Is it possible to get?

@pmeenan
Copy link
Contributor

pmeenan commented Nov 13, 2014

--bodies will turn on the capture of response bodies for text resources (including the base page).The result will then include a "bodies" entry which is a zip file of all of the bodies.

If you know the request number that you want the body for (usually the first unless redirects are involved) then you can request just that body with something like: http://www.webpagetest.org/response_body.php?test=141113_DX_27f460845ddf4d2033d45822727afc4c&run=1&cached=0&request=1

It's worth noting that response bodies are not available for some browser configurations:
Chrome - any HTTPS bodies are not available
IE & Firefox - bodies for SPDY-served requests are not available
Mobile Devices - bodies are not available at all.

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

2 participants