vba to read search results from java post back

jesingl

New Member
Joined
Apr 25, 2013
Messages
7
I am trying to read the search results from an internal company web page.

I can navigate to, input, click send.

When the results come back I have not been able to "read" the results.

Its a javascript postback

The source code for the web page does not change.

The end of source page reads

Sys.Application.initialize();

<INPUT class=SYN_LNN value=8650 type=label unselectable="on"><INPUT id=syn_ctrl8650 class=SYN_BCH role=button value=- type=label unselectable="on">
Sys.Application.add_init(function() {


<INPUT class=SYN_LNN value=8651 type=label unselectable="on"><INPUT id=syn_ctrl8651 class=SYN_BCH role=button value=- type=label unselectable="on">
$create(AjaxControlToolkit.ListSearchBehavior, {"ClientStateFieldID":"ctl00_ContentPlaceHolder1_lse3_ClientState","id":"ctl00_ContentPlaceHolder1_lse3","isSorted":true}, null, null, $get("ctl00_ContentPlaceHolder1_ddlCreatedBy"));


<INPUT class=SYN_LNN value=8652 type=label unselectable="on"><INPUT id=syn_ctrl8652 class=SYN_BCH role=button value=- type=label unselectable="on">
});


<INPUT class=SYN_LNN value=8653 type=label unselectable="on"><INPUT id=syn_ctrl8653 class=SYN_BCH role=button value=- type=label unselectable="on">
Sys.Application.add_init(function() {


<INPUT class=SYN_LNN value=8654 type=label unselectable="on"><INPUT id=syn_ctrl8654 class=SYN_BCH role=button value=- type=label unselectable="on">
$create(AjaxControlToolkit.ListSearchBehavior, {"ClientStateFieldID":"ctl00_ContentPlaceHolder1_lse4_ClientState","id":"ctl00_ContentPlaceHolder1_lse4"}, null, null, $get("ctl00_ContentPlaceHolder1_ddlModule"));


<INPUT class=SYN_LNN value=8655 type=label unselectable="on"><INPUT id=syn_ctrl8655 class=SYN_BCH role=button value=- type=label unselectable="on">
});


<INPUT class=SYN_LNN value=8656 type=label unselectable="on"><INPUT id=syn_ctrl8656 class=SYN_BCH role=button value=- type=label unselectable="on">
Sys.Application.add_init(function() {


<INPUT class=SYN_LNN value=8657 type=label unselectable="on"><INPUT id=syn_ctrl8657 class=SYN_BCH role=button value=- type=label unselectable="on">
$create(AjaxControlToolkit.ListSearchBehavior, {"ClientStateFieldID":"ctl00_ContentPlaceHolder1_lse5_ClientState","id":"ctl00_ContentPlaceHolder1_lse5","isSorted":true}, null, null, $get("ctl00_ContentPlaceHolder1_ddlPSG"));


<INPUT class=SYN_LNN value=8658 type=label unselectable="on"><INPUT id=syn_ctrl8658 class=SYN_BCH role=button value=- type=label unselectable="on">
});


<INPUT class=SYN_LNN value=8659 type=label unselectable="on"><INPUT id=syn_ctrl8659 class=SYN_BCH role=button value=- type=label unselectable="on">
Sys.Application.add_init(function() {


<INPUT class=SYN_LNN value=8660 type=label unselectable="on"><INPUT id=syn_ctrl8660 class=SYN_BCH role=button value=- type=label unselectable="on">
$create(AjaxControlToolkit.ListSearchBehavior, {"ClientStateFieldID":"ctl00_ContentPlaceHolder1_lse6_ClientState","id":"ctl00_ContentPlaceHolder1_lse6","isSorted":true}, null, null, $get("ctl00_ContentPlaceHolder1_ddlManagedBy"));


<INPUT class=SYN_LNN value=8661 type=label unselectable="on"><INPUT id=syn_ctrl8661 class=SYN_BCH role=button value=- type=label unselectable="on">
});


<INPUT class=SYN_LNN value=8662 type=label unselectable="on"><INPUT id=syn_ctrl8662 class=SYN_BCH role=button value=- type=label unselectable="on">
Sys.Application.add_init(function() {


<INPUT class=SYN_LNN value=8663 type=label unselectable="on"><INPUT id=syn_ctrl8663 class=SYN_BCH role=button value=- type=label unselectable="on">
$create(AjaxControlToolkit.ListSearchBehavior, {"ClientStateFieldID":"ctl00_ContentPlaceHolder1_lse8_ClientState","id":"ctl00_ContentPlaceHolder1_lse8","isSorted":true}, null, null, $get("ctl00_ContentPlaceHolder1_ddlMiscContact"));


<INPUT class=SYN_LNN value=8664 type=label unselectable="on"><INPUT id=syn_ctrl8664 class=SYN_BCH role=button value=- type=label unselectable="on">
});


<INPUT class=SYN_LNN value=8665 type=label unselectable="on"><INPUT id=syn_ctrl8665 class=SYN_BCH role=button value=- type=label unselectable="on">
Sys.Application.add_init(function() {


<INPUT class=SYN_LNN value=8666 type=label unselectable="on"><INPUT id=syn_ctrl8666 class=SYN_BCH role=button value=- type=label unselectable="on">
$create(AjaxControlToolkit.ListSearchBehavior, {"ClientStateFieldID":"ctl00_ContentPlaceHolder1_lse10_ClientState","id":"ctl00_ContentPlaceHolder1_lse10","isSorted":true}, null, null, $get("ctl00_ContentPlaceHolder1_ddlReportedBy"));


<INPUT class=SYN_LNN value=8667 type=label unselectable="on"><INPUT id=syn_ctrl8667 class=SYN_BCH role=button value=- type=label unselectable="on">
});


<INPUT class=SYN_LNN value=8668 type=label unselectable="on"><INPUT id=syn_ctrl8668 class=SYN_BCH role=button value=- type=label unselectable="on">
//]]>


<INPUT class=SYN_LNN value=8669 type=label unselectable="on"><INPUT id=syn_ctrl8669 class=SYN_BCH role=button value=- type=label unselectable="on">
</script>


<INPUT class=SYN_LNN value=8670 type=label unselectable="on"><INPUT id=syn_ctrl8670 class=SYN_BCH role=button value=- type=label unselectable="on">
</form>


<INPUT class=SYN_LNN value=8671 type=label unselectable="on"><INPUT id=syn_ctrl8671 class=SYN_BCH role=button value=- type=label unselectable="on">
</body>


<INPUT class=SYN_LNN value=8672 type=label unselectable="on"><INPUT id=syn_ctrl8672 class=SYN_BCH role=button value=- type=label unselectable="on">
</html>




Here is my script

Set IESC = CreateObject("InternetExplorer.Application")
'Create InternetExplorer Object
'start up a new copy of IESC (you could use GetObject
'to access an existing copy of you already had one open
' Set IESC = CreateObject("InternetExplorer.Application")
' You can uncoment Next line To see form results
IESC.Visible = False
'IESC.Visible = True
' Send the form data To URL As POST binary request
IESC.Navigate "http://stnacvd011i/webapps/shopcall/Search.aspx"
' Statusbar
Application.StatusBar = "Loading. Please wait..."
'wait a while until IESC load
Do Until IESC.ReadyState = 4
Loop

' pick up pnum
pnum = Worksheets("ims").Cells(5, 1).Value ' pick up part num

'remove dash numbers
If InStr(pnum, "-") > 0 And InStr(pnum, "M") = 0 Then
pnum = Left(pnum, Len(pnum) - 4)
End If
'remove A
If InStr(pnum, "A") > 0 Or InStr(pnum, "a") > 0 Then
pnum = Right(pnum, Len(pnum) - 1)
End If



'Populate HTML text box with specifIEd date and refresh page

Set OrgBox = IESC.document.getElementById("ctl00_ContentPlaceHolder1_chkDC_From")
OrgBox.Checked = False ' removes created from date check mark

Set OrgBox = IESC.document.getElementById("ctl00_ContentPlaceHolder1_chkDC_To")
OrgBox.Checked = False ' removes date create to check mark

Set OrgBox = IESC.document.getElementById("ctl00_ContentPlaceHolder1_chkLoc")
OrgBox.Checked = False ' ' removes by location check mark

Set OrgBox = IESC.document.getElementById("ctl00_ContentPlaceHolder1_txtPartNo")
OrgBox.Value = (pnum) ' variable part number

Set OrgBox = IESC.document.getElementById("ctl00_ContentPlaceHolder1_chkPartNo")
OrgBox.Checked = True ' adds check mark to part number

'Set OrgBox = IESC.Document.getElementById("ctl00_ContentPlaceHolder1_exportButton")
'OrgBox.disabled = False
'sent to excel

Set OrgBox = IESC.document.getElementById("ctl00_ContentPlaceHolder1_cmdRefresh")
OrgBox.Click ' clicks the search button


 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Forum statistics

Threads
1,223,632
Messages
6,173,467
Members
452,516
Latest member
archcalx

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top