scraper icon indicating copy to clipboard operation
scraper copied to clipboard

Ability to get ElementRef of parent of ElementRef

Open Boscop opened this issue 5 years ago • 3 comments

Please add the ability to get an ElementRef of an ElementRef's parent (and any ancestor/sibling), so that one can call .html() (and other ElementRef methods) on the parent :)

Boscop avatar Apr 12 '20 21:04 Boscop

I think something like elem.parent().and_then(ElementRef::wrap).unwrap() would work.

causal-agent avatar Jul 16 '20 18:07 causal-agent

Maybe it would make sense to add a shortcut method to ElementRef for such a common usecase?

nathaniel-daniel avatar Apr 03 '21 00:04 nathaniel-daniel

@nathaniel-daniel patches are welcome!

teymour-aldridge avatar Aug 03 '22 02:08 teymour-aldridge