In most dom implementations, not without walking the tree (either recursively or with a tree walker). The .string value is just the text that immediately follows the tag up to the next (possibly child) tag.
In bs4, I think there is a get_text() that will work on any element to get all of the text under that element. But I am not 100% on that name.
Last edited by KevinH; 03-28-2018 at 11:52 AM.
|