I'm trying to make sure that while the browser is ready, it waits for seconds until it is ready and the code is executed but this is skipped and the code is executed when the browser is not ready. How do I prevent this from happening? / p>
cls
$ie = New-Object -ComObject InternetExplorer.Application
$ie.navigate2("https://www.youtube.com")
$ie.visible = $true
while($ie.Busy) { Start-Sleep -Milliseconds 100 } <---no esta funcionando
$ie.Document.getElementsByTagName("input")[16].outerHTML
$ie.Quit()