astral
astral copied to clipboard
add ElementHandle.parentElement
Is it expected to add such apis, I use them frequently like this
ElementHandle.parentElement.children[1]
for example
puppetter also doesn't have this, seems the way to do this is with https://pptr.dev/api/puppeteer.page.evaluatehandle
ElementHandle.parentElement.children[1]
The API as written is not technically feasible. At best (with the current API), it could be
await(await ElementHandle.parentElement()).children()[1]
we will be moving to locators soon, which solve this problem. With locators you could just do
Locator.parentElement.children[1]
and it could just work. TLDR; This is dependent on #2
This trick works in puppeteer https://stackoverflow.com/a/66435477/6900891