Trying to locate an input element which seems to actually have a dynamic property of the input element. This input is inside a td and displays Success or Failure on the webpage and is alongside the text Completion Code. Ive tried xpath and id to find the input element but I am getting "unable to locate element" Once I have that first step above, then I want to pull what is in the value field, which is actually the text displayed on the webpage beside Completion Code. For example
Completion Code Success
My code -
completion_code = driver.find_element(By.XPATH, '//*[@id="code"]')
print(completion_code.text)
The html
<tr>
<td id="label.code" class="label" type="string" choice="0" height="23px" nowrap="true">
<label onclick="" for="code" dir="ltr" class=" control-label"><span id="status." mandatory="false" oclass="" aria-label="" class=" required-marker"></span>
<span class="label-text" data-html="false">Completion code</span>
</label>
</td>
<td style="background-color:PaleGreen;width:100%;;" nowrap="true">
<input autocomplete="off" autocorrect="off" readonly="readonly" name="code" id="code" value="Success" onkeyup="" onchange="onChange('code');" size="" style="border:0px;background:transparent" maxlength="" type="text">
</td>
</tr>