0
votes

I have to fetch some data which comes in table after filling some drop downs. Bet when I am selecting dropdowns using getElementsByTagName("select") method it is not returning anything. Here is my code:

path:="http://somewebsite.com"

wb := ComObjCreate("InternetExplorer.Application")
wb.visible := false

Load(wb, path)
inputs := wb.Document.getElementsByTagName("select")
;inputs := wb.document.all.4BBCFB71421E47CD15CA52B8AE2847AD.name
l := inputs.length
MsgBox %l%

Load(wb, what){
wb.navigate(what)
while wb.Busy
continue
wb.Visible := true
}

This code is printing 0 always. Any help will be much appreciated.

1
Capitalization has nothing to do with it. AHK (and many other interfaces) have a problem sometimes with TagName (and ClassName) especially within a form (for example). Try it as inputs := wb.Document.Form[0].getElementsByTagName("select") and if that doesn't work, maybe loop through them using the index inputs := wb.Document.getElementsByTagName("select")[0].innerhtml (or referencing the Form[0]) and let us know.PGilm

1 Answers

0
votes

Is "Document" capitalized in your actual code?

I believe the issue might be that "Document" is the prototype object that every "document" is an instance of, so "Document" doesn't hold the specific tags or data of any page being viewed.

Example image here from IE11's console