This is a quick and dirty way of getting a browser link.
Sleep(3000)
$WTitle = WinGetTitle('[ACTIVE]')
Send('{F6}')
Sleep(100)
Send('{APPSKEY}')
Sleep(100)
Send('c')
Sleep(100)
Send('{F6}')
$Link = ClipGet()
ToolTip($Link, 0, 0, 'Link', 1)
When messing with functions that require the internet, i'm a much bigger fan of using the ie functions that are present in autoit already.
If you want to leave the loop, place a condition, and then exitloop when the condition is met.
Hope this helps.