【发布时间】:2019-05-18 05:46:29
【问题描述】:
你好,上面的代码适用于星期选择,但不适用于选择时间
<td style="white-space:nowrap;">Master Timings</td>
<td>
<select name="ddlSTSun" id="ddlSTSun" onChange="return ChangeAllSTET(frmRosterInfoTLEmp,'ddlSTSun','ddlST1Sun02');" style="font-family:Arial;font-size:9pt;">
<option value="01:00">01:00</option>
<option value="02:00">02:00</option>
<option value="03:00">03:00</option>
<option value="04:00">04:00</option>
<option value="05:00">05:00</option>
<option value="06:00">06:00</option>
<option value="07:00">07:00</option>
我的 VBA 代码是
ie.Document.getElementsByTagName("iframe")(0).contentDocument.querySelector("[name=cmbWeeks]").selectedIndex = "Week:-2 19-May-2019"
ie.Document.getElementsByTagName("iframe")(0).contentDocument.querySelector("[name=cmbWeeks]").FireEvent ("onchange")
Sleep 5000
ie.Document.getElementsByTagName("iframe")(0).contentDocument.querySelector("[name=ddlSTSun]").selectedIndex = "12:00"
ie.Document.getElementsByTagName("iframe")(0).contentDocument.querySelector("[name=ddlSTSun]").FireEvent ("onchange")
【问题讨论】:
标签: html vba web-scraping screen-scraping