TDM
Wed Oct 12 12:09:03 CDT 2005
"lawhurts" <amarhasan@gmail.com> wrote in message
news:1129071089.936404.77370@z14g2000cwz.googlegroups.com...
>I can't use objIEA.Navigate "
http://your_domain/your_page/htm" to get
> to the page I need to get to because it is a deep link that can only be
> accessed once an appropriate log-in has occurred. So, I got to the 1st
> page --> enter the login information, do some navigation, and I get to
> the page with the checboxes. If I try to copy the address of the final
> page with the checkboxes and paste it into a browser it says that I
> have been automatically logged off. So, it appears there is some type
> of security mechanism that prevents deep linking. So, I need a way to
> navigate to the page that is already open. Is there a way to do this?
>
There is a way, but it gets a bit tricky and requires that you have
access to the tag ID's which you should be able to obtain by looking
at the source. I generally dont support this type of thing
as web pages change, so you then need to change your code. A
while back I put this script together for another post a while ago. It may
help
you at least get an idea of what you need to do. This script visits
a page, goes through 2 select lists and in one, selects USD, in the
other, it selects everything, then submits the page. You will need
to modify this to find your input tags for your login info, then submit
the page. Then, on the next page, I assume it will be the one where
you want to select the checkboxes, you can then do so via code
if you know either the NAME or ID, or perhaps the ALL collection
will work as well. Without really being able to visit the page you mention,
I cant be of much more help than this.
To emphasize why I dont support this type of thing, notice this script
no longer works.
Dim objIe1
Dim objIe1Doc
Dim objFrm
Dim i
Const URL = "
http://www.oanda.com/convert/fxdaily"
Set objIe1=WScript.CreateObject("InternetExplorer.Application")
With objIe1
.Visible = True
.Navigate URL
Do Until .ReadyState = 4
WScript.Sleep 50
Loop
End With
Set objIe1Doc = objIe1.Document
With objIe1Doc
For i = 0 To .getElementById("exch").Length - 1
If .getElementById("exch").Item(i).Value = "USD" Then
.getElementById("exch").Item(i).Selected = True
End If
Next
For i = 0 To .getElementById("Currency").Length - 1
.getElementById("Currency").Item(i).Selected = True
Next
.All.dest.click
End With
Set objIeDoc = Nothing
WScript.Sleep 5000
Set objIe1Doc = objIe1.Document
With objIe1Doc
For i = 0 To .Links.Length - 1
If InStr(1, .Links(i).href, "format=CSV", 1) Then
WScript.Echo .Links(i)
.Links(i).Click
Exit For
End If
Next
End With
TDM