How to get all xml/dom as text under a parent web element using selenium/python?

How to get all xml/dom as text under a parent web element using selenium/python?

I have a scenario that requires working on a UI object displayed as a grid but the rows and columns are separate web elements contained in the xml / dom hierarchy consisting of multiple xpaths that can be parsed using a common pattern. All these elements contain texts corresponding to the column type. Getting all these texts by webelement references one by one takes time. Is there a way to get all this xml as text (or for at least one row in a single shot) to save extraction time by parsing entire xml inline.

I have a scenario that requires working on a UI object displayed as a grid but the rows and columns are separate web elements contained in the xml / dom hierarchy consisting of multiple xpaths that can be parsed using a common pattern. All these elements contain texts corresponding to the column type. Getting all these texts by webelement references one by one takes time. Is there a way to get all this xml as text (or for at least one row in a single shot) to save extraction time by parsing entire xml inline.

For example, consider the bottom mentioned xml. How can i get all xml hierarchy underneath <div[@class='table']> as text to parse or even for entire first row in the table.

<div[@class='table']>
         <div[@class='rows']>
              <div[@class='row']>[0]:

This is the sample example:

<div[@class='table']>
     <div[@class='rows']>
          <div[@class='row']>
               <div[@class='col']>
                   <div[@class='element']>some_text1</div[@class='element']>
                   <div[@class='element']>some_text2</div[@class='element']>
                   <div[@class='element']>some_text3</div[@class='element']>
                   ...
               </div[@class='col']>
          </div[@class='row']>
          <div[@class='row']>
               <div[@class='col']>
                   <div[@class='element']>some_text1</div[@class='element']>
                   <div[@class='element']>some_text2</div[@class='element']>
                   <div[@class='element']>some_text3</div[@class='element']>
                   ...
               </div[@class='col']>
          </div[@class='row']>
          <div[@class='row']>
               ...
          </div[@class='row']>
          <div[@class='row']>
               ...
          </div[@class='row']>
          <div[@class='row']>
               ...
          </div[@class='row']>
     </div[@class='rows']>
</div[@class='table']>


Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Selenium with Python

Selenium with Python

Selenium WebDriver With Python 3.x - Novice To Ninja

Selenium WebDriver With Python 3.x - Novice To Ninja

Selenium Python

Selenium Python - is one of the widely used tools used for Web Browser Automation, and offers a lot of functionality and power over a browser.