Selenium_日期选择器(日历)Python

wkyowqbh  于 2022-11-24  发布在  Python
关注(0)|答案(1)|浏览(144)

我正在写代码与 selenium ,以履行信息在一个网站。我不能指示代码选择一个特定的日期。
下面是html代码:

<div id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP" name="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_HXPOPUP" style="position: absolute; top: 482px; left: 425px; z-index: 1000000; padding: 0px; margin: 0px; vertical-align: top; overflow: visible; display: block; visibility: visible;" class="inputText_DatePicker">
<table id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_TABLE" border="0" cellspacing="0" cellpadding="0" class="inputText_DatePicker-Size">
<tbody><tr><td valign="top" align="left">
<table id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_HDR_TABLE" border="0" cellspacing="0" cellpadding="0" class="inputText_DatePicker-Header" width="100%">
<tbody><tr><td valign="middle" align="right" class="inputText_DatePicker-HeaderLine1">
<img id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221129O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;">
<span unselectable="on">29</span>
</td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221130O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;">
<span unselectable="on">30</span>
</td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221201X"

我已经尝试了这个网站中的所有代码,但没有找到解决方案.

pexxcrt2

pexxcrt21#

<div id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP" name="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_HXPOPUP" style="position: absolute; top: 482px; left: 425px; z-index: 1000000; padding: 0px; margin: 0px; vertical-align: top; overflow: visible; display: block; visibility: visible;" class="inputText_DatePicker"><table id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_TABLE" border="0" cellspacing="0" cellpadding="0" class="inputText_DatePicker-Size"><tbody><tr><td valign="top" align="left"><table id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_HDR_TABLE" border="0" cellspacing="0" cellpadding="0" class="inputText_DatePicker-Header" width="100%"><tbody><tr><td valign="middle" align="right" class="inputText_DatePicker-HeaderLine1"><img id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_HDRBTN1" class="inputText_DatePicker-Button" src="https://www.cdsservices.ca/solutions/isin/.ibmjsfres/img/1x1.gif" title="Previous year" alt="Previous year" style="background-image: url(&quot;https://www.cdsservices.ca/solutions/isin/.ibmjsfres/img/hinkies_vlg_v3_0_12.gif&quot;); background-position: 0px -12px; background-repeat: no-repeat; margin: 0px; cursor: pointer;"></td><td valign="middle" align="center" class="inputText_DatePicker-HeaderYear">2022</td><td valign="middle" align="left" class="inputText_DatePicker-HeaderLine1"><img id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_HDRBTN2" class="inputText_DatePicker-Button" src="https://www.cdsservices.ca/solutions/isin/.ibmjsfres/img/1x1.gif" title="Next year" alt="Next year" style="background-image: url(&quot;https://www.cdsservices.ca/solutions/isin/.ibmjsfres/img/hinkies_vlg_v3_0_12.gif&quot;); background-position: 0px 0px; background-repeat: no-repeat; margin: 0px; cursor: pointer;"></td></tr><tr><td valign="middle" align="right" class="inputText_DatePicker-HeaderLine2"><img id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_HDRBTN3" class="inputText_DatePicker-Button" src="https://www.cdsservices.ca/solutions/isin/.ibmjsfres/img/1x1.gif" title="Previous month" alt="Previous month" style="background-image: url(&quot;https://www.cdsservices.ca/solutions/isin/.ibmjsfres/img/hinkies_vlg_v3_0_12.gif&quot;); background-position: 0px -12px; background-repeat: no-repeat; margin: 0px; cursor: pointer;"></td><td valign="middle" align="center" class="inputText_DatePicker-HeaderMonth">November</td><td valign="middle" align="left" class="inputText_DatePicker-HeaderLine2"><img id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_HDRBTN4" class="inputText_DatePicker-Button" src="https://www.cdsservices.ca/solutions/isin/.ibmjsfres/img/1x1.gif" title="Next month" alt="Next month" style="background-image: url(&quot;https://www.cdsservices.ca/solutions/isin/.ibmjsfres/img/hinkies_vlg_v3_0_12.gif&quot;); background-position: 0px 0px; background-repeat: no-repeat; margin: 0px; cursor: pointer;"></td></tr></tbody></table></td></tr><tr><td valign="top" align="left"><table id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_BODY_TABLE" border="0" cellspacing="0" cellpadding="0" class="inputText_DatePicker-Body" width="100%"><tbody><tr><td valign="middle" align="center" class="inputText_DatePicker-HeaderWeekday" style="cursor: pointer;"><span unselectable="on">S</span></td><td valign="middle" align="center" class="inputText_DatePicker-HeaderWeekday" style="cursor: pointer;"><span unselectable="on">M</span></td><td valign="middle" align="center" class="inputText_DatePicker-HeaderWeekday" style="cursor: pointer;"><span unselectable="on">T</span></td><td valign="middle" align="center" class="inputText_DatePicker-HeaderWeekday" style="cursor: pointer;"><span unselectable="on">W</span></td><td valign="middle" align="center" class="inputText_DatePicker-HeaderWeekday" style="cursor: pointer;"><span unselectable="on">T</span></td><td valign="middle" align="center" class="inputText_DatePicker-HeaderWeekday" style="cursor: pointer;"><span unselectable="on">F</span></td><td valign="middle" align="center" class="inputText_DatePicker-HeaderWeekday" style="cursor: pointer;"><span unselectable="on">S</span></td></tr><tr><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221030X" class="inputText_DatePicker-OtherMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">30</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221031X" class="inputText_DatePicker-OtherMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">31</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221101O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">1</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221102O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">2</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221103O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">3</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221104O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">4</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221105O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">5</span></td></tr><tr><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221106O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">6</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221107O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">7</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221108O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">8</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221109O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">9</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221110O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">10</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221111O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">11</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221112O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">12</span></td></tr><tr><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221113O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">13</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221114O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">14</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221115O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">15</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221116O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">16</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221117O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">17</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221118O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">18</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221119O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">19</span></td></tr><tr><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221120O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">20</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221121O" class="inputText_DatePicker-CurrentToday" tabindex="1" style="cursor: pointer;"><span unselectable="on">21</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221122O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">22</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221123O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">23</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221124O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">24</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221125O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">25</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221126O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">26</span></td></tr><tr><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221127O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">27</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221128O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">28</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221129O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">29</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221130O" class="inputText_DatePicker-CurrentMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">30</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221201X" class="inputText_DatePicker-OtherMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">1</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221202X" class="inputText_DatePicker-OtherMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">2</span></td><td valign="middle" align="center" id="subview1:itemViewFragment1:itemForm1:texti0023_POPUP_DAY_20221203X" class="inputText_DatePicker-OtherMonth" tabindex="1" style="cursor: pointer;"><span unselectable="on">3</span></td></tr><tr style="display: none;"><td valign="middle" align="center" id="" style="cursor: pointer;"></td><td valign="middle" align="center" id="" style="cursor: pointer;"></td><td valign="middle" align="center" id="" style="cursor: pointer;"></td><td valign="middle" align="center" id="" style="cursor: pointer;"></td><td valign="middle" align="center" id="" style="cursor: pointer;"></td><td valign="middle" align="center" id="" style="cursor: pointer;"></td><td valign="middle" align="center" id="" style="cursor: pointer;"></td></tr></tbody></table></td></tr></tbody></table></div>

相关问题