Using Python 3.
Supposing:
<whatever>
text
<subchild>
other
</subchild>
</whatever>
If I do:
elem = driver.find_element_by_xpath("//whatever")
elem.text contains "text other"
If I do:
elem = driver.find_element_by_xpath("//whatever/text()[normalize-space()]")
elem is not Webelement.
How my I proceed to grab only "text" (and not "other")?
Id est: grab only text in direct node, not the child nodes.
UPDATE:
Original HTML is:
<div class="border-ashes the-code text-center">
VIVEGRPN
<span class="cursor"></span>
<button class="btn btn-ashes zclip" data-clipboard-target=".the-code" data-coupon-code="VklWRUdSUE4=">
<span class="r">Hen, la.</span>
</div>