I am retrieving an array of elements from a webpage via .getElementsByTagName(). I am then looping through the array and printing out the elements' titles:
$links = $ie.document.GetElementsByTagName("a")
Foreach($link in $links)
{
$link.title
}
This works. However a for loop better suits my needs, and this only seems to print out blank lines:
$links = $ie.document.GetElementsByTagName("a")
for($i=0; $i -lt $links.length; $i++)
{
$links[$i].title
}
Why does the second loop not print the title?