On the website I am exploring, there is a dynamic graph with descriptions below it that keep changing. My goal is to extract all these trajectory descriptions. The HTML code snippet related to the description area looks like this:
<div class="trajDescription" id="traj-description" classname="trajDescription">
<b>34.3</b>
Mohammad Nawaz to Eoin Morgan, 55.0 mph, dot ball.
</div>
Using selenium, when I attempt to locate and retrieve the text from this element:
traj_description = driver.find_element_by_css_selector('#traj-description')
print(traj_description.text)
I only get a single sentence as the output, such as:
40.1 Chris Woakes to Sarfraz Ahmed, 84.2 mph, 1 run, hit straight down the ground.
I am wondering if there are any techniques or methods available to capture all the varied descriptions, similar to:
Mohammad Nawaz to Eoin Morgan, 55.0 mph, dot ball.
Mohammad Nawaz to Eoin Morgan, 45.0 mph, down to the ground.
Chris Woakes to Sarfraz Ahmed, 84.2 mph, 1 run, hit straight down the ground