We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
ShadowDOM
Page.content()
current Page.content() not include shadow dom content
API:
await page.content({ serializableShadowRoots: true });
Related spec: https://html.spec.whatwg.org/#dom-parsing-and-serialization
Implement
const doctype = document.doctype ? new XMLSerializer().serializeToString(document.doctype) : ''; // https://html.spec.whatwg.org/#dom-parsing-and-serialization if (!('getHTML' in Element.prototype)) { return `${doctype}${document.documentElement.outerHTML}`; } const body = (document.documentElement as any).getHTML({ serializableShadowRoots: true }); const uid = crypto.randomUUID(); document.documentElement.innerHTML = uid; return `${doctype}${document.documentElement.outerHTML.replace( uid, body )}`;
Let the crawler(e.g: renderscript) grab everything
The text was updated successfully, but these errors were encountered:
No branches or pull requests
馃殌 Feature Request
current
Page.content()
not include shadow dom contentExample
API:
Related spec: https://html.spec.whatwg.org/#dom-parsing-and-serialization
Implement
Motivation
Let the crawler(e.g: renderscript) grab everything
The text was updated successfully, but these errors were encountered: