need to get sentence between tags with Selenium and Python :
<h2 id='PO-PF2' class="section">Program Information</h2>
Length: Two-year Ontario College Graduate Certificate program
<br />Delivery Sequence:<br />
Using find_element_by_xpath in different variations didn't return any results.
Using driver.find_element_by_tag_name("body").text and then parse it for required sentence works but is there any other way ?
Expected result : Length: Two-year Ontario College Graduate Certificate program
UPD:
'(?<=Length:)([\s\S]*?)(?=\n)'
Covered all needed cases