Closed milahu closed 5 months ago
Hmm tbh that sounds like a lot of work to me. Why not just ust JavaScript at that point? Returning elements with javascript should work with serialisation as expected & return a WebElement
Also, I suppose adding an awaitable property shaddow
to WebElement
is worth a consideration
Why not just ust JavaScript at that point?
yeah, less back-and-forth between py and js
await elem.shadow
?
as a generic interface for iframe.content_document
and others?
Why not just JavaScript at that point?
yeah, less back-and-forth between py and js
let's close that issue then:)
await elem.shadow
? as a generic interface foriframe.content_document
and others?
Exactly. Especially for closed shaddow dom, where JS doesn't have access to my knowledge. Shall we open a feature request issue for that?
let's close that issue then
no, this would be a nice feature
this only breaks because chromium removed it using more javascript is just an implementation detail
div = await driver.find_element(By.CSS_SELECTOR, "iframe /deep/ div")
await elem.shadow
for my taste, this should be even simpler
- (await iframe.shadow).find_element
+ iframe.find_element
iframe = await driver.find_element(By.CSS_SELECTOR, "iframe")
div = await iframe.find_element(By.CSS_SELECTOR, "div")
or call it "document", because thats what it is
- (await iframe.shadow).find_element
+ (await iframe.document).find_element
iframe = await driver.find_element(By.CSS_SELECTOR, "iframe")
iframe_doc = await iframe.document
div = await iframe_doc.find_element(By.CSS_SELECTOR, "div")
let's close that issue then
no, this would be a nice feature
this only breaks because chromium removed it using more javascript is just an implementation detail
div = await driver.find_element(By.CSS_SELECTOR, "iframe /deep/ div") ``
well you can open a PR on that if you want:) Don't really have the time to implement that tbh.
await elem.shadow
for my taste, this should be even simpler
- (await iframe.shadow).find_element + iframe.find_element
mhh yeah simpler, but also leads to unclear behaviour, right? For example the order of the child elemets, etc.
or call it "document", because thats what it is
- (await iframe.shadow).find_element + (await iframe.document).find_element
mhh I'd prefer shaddow thb. I'd say It's more clear what's meant with it. So similar to elem.shadowRoot
in JS
the css
/deep/
combinator is useful to reduce boilerplate code when dealing with shadow DOMthe
/deep/
combinator is no longer supported bydocument.querySelector
implementing this would require
/deep/
combinators (or>>>
combinators)document.querySelector
orparentElement.querySelector
StaleElementReferenceException
see also
similar #144