尝试 select 一个复选框但没有得到 selected
Trying to select a check box but not getting selected
<div class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable" tabindex="-1" role="dialog" aria-labelledby="ui-dialog-title-imageModel" style="display: block; z-index: 1002; outline: 0px; height: auto; width: 700px; top: 225.5px; left: 278.5px;"><div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix"><span class="ui-dialog-title" id="ui-dialog-title-imageModel">ATTENTION TAX PAYERS!!!!!</span><a href="#" class="ui-dialog-titlebar-close ui-corner-all" role="button" style="display: none;"><span class="ui-icon ui-icon-closethick">close</span></a></div><div id="imageModel" class="ui-dialog-content ui-widget-content" style="width: auto; min-height: 0px; height: 92.4px;" scrolltop="0" scrollleft="0">
<ul><li class="redFont"> Please insist on getting Form 16/16A from your Deductor downloaded only from Traces.Valid form 16/16A.<a href="http://contents.tdscpc.gov.in/images/third-party-form-26AS.png" target="_blank"><i><u> click here.</u></i></a></li></ul>
<div class="floatLeft margintop20"><input type="checkbox" id="Details" name="Details" onclick="checkModal('modalPagee')"> I agree to the usage and acceptance of Form 16 / 16A generated from TRACES</div>
<div class="floatLeft margintop20">
<input value="Proceed" type="button" class="button" id="btn" disabled="disabled" onclick="goCancel()">
</div>
</div></div>
这是我正在处理的 HTML 代码,这里我想 select 复选框类型的输入元素,当我尝试它时
check_box = find_element_by_id("Details").click()
我没能 select 它。
如果需要更多详细信息
"https://www.incometax.gov.in/iec/foportal"
请访问本站,
当在 login, goto -> e-file -> income_tax_returns -> view for 26as
和 continue
之后,我们将得到 another window opened
并在 pop up
中得到 popup
我们需要 select the checkbox.
详细信息在新标签中,您需要如下切换焦点:
wait = WebDriverWait(driver, 10)
new_handle = driver.window_handles
print(len(new_handle))
driver.switch_to.window(new_handle[1])
wait.until(EC.element_to_be_clickable((By.ID, "Details"))).click()
尝试:
check_box = find_element_by_xpath('//*[@id="Details"]').click()
<div class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable" tabindex="-1" role="dialog" aria-labelledby="ui-dialog-title-imageModel" style="display: block; z-index: 1002; outline: 0px; height: auto; width: 700px; top: 225.5px; left: 278.5px;"><div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix"><span class="ui-dialog-title" id="ui-dialog-title-imageModel">ATTENTION TAX PAYERS!!!!!</span><a href="#" class="ui-dialog-titlebar-close ui-corner-all" role="button" style="display: none;"><span class="ui-icon ui-icon-closethick">close</span></a></div><div id="imageModel" class="ui-dialog-content ui-widget-content" style="width: auto; min-height: 0px; height: 92.4px;" scrolltop="0" scrollleft="0">
<ul><li class="redFont"> Please insist on getting Form 16/16A from your Deductor downloaded only from Traces.Valid form 16/16A.<a href="http://contents.tdscpc.gov.in/images/third-party-form-26AS.png" target="_blank"><i><u> click here.</u></i></a></li></ul>
<div class="floatLeft margintop20"><input type="checkbox" id="Details" name="Details" onclick="checkModal('modalPagee')"> I agree to the usage and acceptance of Form 16 / 16A generated from TRACES</div>
<div class="floatLeft margintop20">
<input value="Proceed" type="button" class="button" id="btn" disabled="disabled" onclick="goCancel()">
</div>
</div></div>
这是我正在处理的 HTML 代码,这里我想 select 复选框类型的输入元素,当我尝试它时
check_box = find_element_by_id("Details").click()
我没能 select 它。
如果需要更多详细信息
"https://www.incometax.gov.in/iec/foportal"
请访问本站,
当在 login, goto -> e-file -> income_tax_returns -> view for 26as
和 continue
之后,我们将得到 another window opened
并在 pop up
中得到 popup
我们需要 select the checkbox.
详细信息在新标签中,您需要如下切换焦点:
wait = WebDriverWait(driver, 10)
new_handle = driver.window_handles
print(len(new_handle))
driver.switch_to.window(new_handle[1])
wait.until(EC.element_to_be_clickable((By.ID, "Details"))).click()
尝试:
check_box = find_element_by_xpath('//*[@id="Details"]').click()