Selecting parents
Feature goal
When I encounter some webpage like this:
<x><y>hey</y> wat</x>
I want to select the tag x, and get the text " wat". The characteristic for this tag is that it's a parent of some other tag containing text "hey".
There doesn't seem to be one help me to do so. For now I just use "E:nth-of-type" to find it by index, but this seems fragile as once the element moves this will break.
Dependencies
None
This was fixed in #624 with the implementation of the :has pseudo-selector, should be released in v0.38 soon.
As @bvobart mentioned, we now have the :has pseudo-selector (from v0.38). I think you can work with a combination of :has(y:fl-contains('hey')) and Floki.text() with the :deep option set to false. See the docs: https://hexdocs.pm/floki/Floki.html#text/2
I'm going to close this one, but feel free to comment if you have any questions.