Hello,
We have successfully used the script listed below to check/select various items on a webpage (Website1), and then search. This is repeated every 15 minutes. Everything works great.
However, on a different, older version of the website (Website2), which we also need to manipulate, this code does not work because the fields in the loop – statusF, statusFS, optL12H – do not exist. These are IDs, but in the other version of the website, the ID fields simply don’t exist.
Here is what I mean.
Website 1:
input type="checkbox" name="status" value="0" id="statusA" /><img title="Transfer in Progress" src="/coreadmin/images/common/in_progress2.gif"/>
<input type="checkbox" name="status" value="2" id="statusF" /><img title="Transfer Failed" src="/coreadmin/images/common/failed_16.gif"/>
<input type="checkbox" name="status" value="3" id="statusFS" /><img title="Failed Subtransmission" src="/coreadmin/images/common/icon_pta_failure.gif"/>
Website 2 (same as above, but with no IDs specified)
<input type="checkbox" name="status" value="0" /><img title="Transfer in Progress" src="/coreadmin/images/common/in_progress2.gif"/>
<input type="checkbox" name="status" value="2" /><img title="Transfer Failed" src="/coreadmin/images/common/failed_16.gif"/>
<input type="checkbox" name="status" value="3" /><img title="Failed Subtransmission" src="/coreadmin/images/common/icon_pta_failure.gif"/></td></tr>
We cannot change the code of the websites because they do not belong to us. Is there anything we can do? How can we specify if no ID is present? The “name” field is the same for several (not unique). Any input would be appreciated.
Script that works on Website1, but not Website2:
Set IE = CreateObject("InternetExplorer.Application")
set WshShell = CreateObject("WScript.Shell")
IE.Navigate " IE.Visible = True
WScript.Sleep 10000
Do While True
WScript.Sleep 150000
IE.Document.All.Item("statusF").Checked = true
IE.Document.All.Item("statusFS").Checked = true
IE.Document.All.Item("optL12H").Selected = true
IE.Document.All.Item("search").Click()
Loop
We have successfully used the script listed below to check/select various items on a webpage (Website1), and then search. This is repeated every 15 minutes. Everything works great.
However, on a different, older version of the website (Website2), which we also need to manipulate, this code does not work because the fields in the loop – statusF, statusFS, optL12H – do not exist. These are IDs, but in the other version of the website, the ID fields simply don’t exist.
Here is what I mean.
Website 1:
input type="checkbox" name="status" value="0" id="statusA" /><img title="Transfer in Progress" src="/coreadmin/images/common/in_progress2.gif"/>
<input type="checkbox" name="status" value="2" id="statusF" /><img title="Transfer Failed" src="/coreadmin/images/common/failed_16.gif"/>
<input type="checkbox" name="status" value="3" id="statusFS" /><img title="Failed Subtransmission" src="/coreadmin/images/common/icon_pta_failure.gif"/>
Website 2 (same as above, but with no IDs specified)
<input type="checkbox" name="status" value="0" /><img title="Transfer in Progress" src="/coreadmin/images/common/in_progress2.gif"/>
<input type="checkbox" name="status" value="2" /><img title="Transfer Failed" src="/coreadmin/images/common/failed_16.gif"/>
<input type="checkbox" name="status" value="3" /><img title="Failed Subtransmission" src="/coreadmin/images/common/icon_pta_failure.gif"/></td></tr>
We cannot change the code of the websites because they do not belong to us. Is there anything we can do? How can we specify if no ID is present? The “name” field is the same for several (not unique). Any input would be appreciated.
Script that works on Website1, but not Website2:
Set IE = CreateObject("InternetExplorer.Application")
set WshShell = CreateObject("WScript.Shell")
IE.Navigate " IE.Visible = True
WScript.Sleep 10000
Do While True
WScript.Sleep 150000
IE.Document.All.Item("statusF").Checked = true
IE.Document.All.Item("statusFS").Checked = true
IE.Document.All.Item("optL12H").Selected = true
IE.Document.All.Item("search").Click()
Loop