manganet2
asked on
WinHTTP, Frames, and SID - problems collecting data from site.
I need help with WinHTTP. I am trying to pull tote board data from UsOfftrack.com. from the url http://65.116.75.195/link2tote/main.aspx you can navigate to relevant data for tracks in the us.
I can get to programs.aspx fine, but when I try to go to data.aspx. it says my session has expired. Using IE web Browser, I noticed a funny SID inserted in the path. I checked the source, but nada. As a test I tried typing in the url for track data that would normally go in the Data Frame (Center Screen). It would always revert back to main.aspx. I tried right clicking a link from the Programs Frame to open in a new window. It worked. Great, but why can I not do this in WinHTTP. Opps! Spoke too soon. The page self refreshed to an error page. I did the previous steps again to get to a data page and quickly right clicked to view source, No refresh tag. How is that possible?
Anyway, can someone look at this site and tell me how to use the WinHTTP object to get data from each frame, Programs and Data Frames. Also, where is that SID coming from and how do I capture to us it.
I would like to build a Server COM Component to collect this data routinely.
I can get to programs.aspx fine, but when I try to go to data.aspx. it says my session has expired. Using IE web Browser, I noticed a funny SID inserted in the path. I checked the source, but nada. As a test I tried typing in the url for track data that would normally go in the Data Frame (Center Screen). It would always revert back to main.aspx. I tried right clicking a link from the Programs Frame to open in a new window. It worked. Great, but why can I not do this in WinHTTP. Opps! Spoke too soon. The page self refreshed to an error page. I did the previous steps again to get to a data page and quickly right clicked to view source, No refresh tag. How is that possible?
Anyway, can someone look at this site and tell me how to use the WinHTTP object to get data from each frame, Programs and Data Frames. Also, where is that SID coming from and how do I capture to us it.
I would like to build a Server COM Component to collect this data routinely.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Found this in the Programs.aspx.
<form name="frmMain" method="post" action="programs.aspx?Spor t=2" id="frmMain"><input type="hidden" name="__VIEWSTATE"
value="dDw0NDI3MzU5MzA7Oz7 9KTDBOOr8l 6zAiHVqTvy FR1M/yg==" />
This may be needed to maintain the session. Don't Know!!
<form name="frmMain" method="post" action="programs.aspx?Spor
value="dDw0NDI3MzU5MzA7Oz7
This may be needed to maintain the session. Don't Know!!
ASKER
.Open "GET", "http://65.116.75.195" & Location & "data.aspx?ProgramKey=2033
This would normally update data.aspx to point to the track indicated, but we are not using frames.
The response is
First Get Using - .Open "GET", "http://65.116.75.195" & Location & "main.aspx", True
Location: /link2tote/(agxdti2irjsjzr
Second Get using - .Open "GET", "http://65.116.75.195" & Location & "data.aspx?ProgramKey=2033
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href='/link2tote/(agxdti2i
</body></html>
Third Get using - .Open "GET", "http://65.116.75.195" & Location & "reload.htm", True
<html>
<body onload="top.window.locatio
<h5>Your session has expired. Reloading main page...</h5>
</body>
</html>
If I were in the IE Browser UI, it would just update the Data Frame and you could see the data I am after. It is not as simple programatically for some reason.