Basically, I have a list of server ips ($list). I need to take each of these, go to a web page, enter a search query and press the Search button. Once the search button is pressed, a new table is generated at the bottom of the page which has information about the server. From this, I need the location of the server, which is the second column of the table.
$list = get-content "servers.txt"
$url = "somewebsite.php"
foreach ($item in $list) {
try {
$ie = New-Object -ComObject InternetExplorer.Application
$ie.visible = $true
$ie.Navigate($url)
while($ie.Busy){Start-Sleep 1}
$ie.Document.getElementsByTagName("input") | ? { $_.Name -eq 'ip_address' } | % { $_.value = $item }
$ie.Document.getElementsByTagName("input") | ? { $_.Value -eq 'search' } | % { $_.Click() }
while($ie.Busy){Start-Sleep -s 3}
# $ie.Refresh()
}
catch {
$_ > error.txt
}
}
The HTML for the newly generated table looks like this: here
Any ideas on how to query the table and get the table data (ORL T)?
Thanks in advance!