Skip to content

Avoid passing DOM between node & child node / shadow root #6

@rickd3ckard

Description

@rickd3ckard

`Node? shadowRootContainer = await tab.SelectNode("div[id="usercentrics-root"]");
if (shadowRootContainer == null) { throw new ArgumentNullException(nameof(shadowRootContainer)); }
if (shadowRootContainer.ShadowRoots == null) { throw new ArgumentNullException(nameof(shadowRootContainer.ShadowRoots)); }
Node shadowroot = shadowRootContainer.ShadowRoots[0];

shadowroot.DOM = shadowRootContainer.DOM; <==================== this line I mean

Node? acceptCookieButton = await shadowroot.SelectNode("button[class="sc-dcJsrY liDFoy"]");
if (acceptCookieButton != null) { await acceptCookieButton.Click(MouseButtonEnum.left); Thread.Sleep(500); }`

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions