I’d like to select the text inside ‘updatedOn_1756’, which would typically return something like “10:12 PM”. How would I do this? I thought it would be something like element = driver.find_element(:id, “updatedOnID”), but that doesn’t work. I’m using Firefox, incidentally.
EDIT: I believe the page is dynamically updated. Though there is no text inside the source shown here, there is a time displayed on the page (it doesn’t show in the page source when I click ‘view source’).
<tr id='row_for_1756' >
<td class="IDClass">1756</td>
<td>Jameson</td>
<td><a id='DrinkName_1756' class="linkToClient" title="Launch Live Viewer" href='/client/Client.application?myid=1756'>Stevens 18</a> -
<a title="BETA Client" href='/client/Client.application?bell=1756' style="color: green; font-weight: bold;">(BETA VERSION)</a> - <a id='DrinkName_Old_1756' class="linkToClient" title="Version before" href='/client/blank/Client.application?myid=1756' style="color: Red;">(old version)</a></td>
<td>9980</td>
<td><span id='updatedOn_1756' class="updatedOnID"></span></td>
<td><span id='histUpdatedOn_1756' class="updatedOnID"></span></td>
</tr>
The reason it doesn’t work is because you’re asking for an
idwith the valueupdatedOnID, which doesn’t exist. There is a class with that value, but since you’re looking for theid, you’ll need the entire ID value, including the number: