javascript - Is it possible to get the DOM structure of a page after all JS executes? -
it's pretty straightforward use curl or (in php) stream contexts/file_get_contents
starting html markup of page, nowadays, many pages being heavily controlled js, if starting markup page, still cannot readily determine actual makeup of page (because of page made js running client-side).
as such, possible entire dom structure of page after on-load js page executes using curl, etc.?
(as bit of info, know can dom structure chrome dev tools, etc., i'm wondering if there's way automate process.)
thank much.
you'll have run in browser, contents of document.documentelement.outerhtml
.
i don't think possible in php alone. you'll have use:
-
phantomjs headless webkit scriptable javascript api. access , manipulate webpages standard dom api, or usual libraries jquery.
or slimerjs.
slimerjs similar phantomjs, except runs gecko, browser engine of mozilla firefox, instead of webkit.
Comments
Post a Comment