Overview- Im building a websurfing program that surfs webpages from a list. I Want it to be able to tell which Url is currently surfed and do a If statement if a match is found within the URL.
#include <IE.au3>
Local $aURLs, $oIE, $twit, $test
start()
Func start()
$twit = "twitter.com"
Dim $aURLs
_FileReadToArray("sites.txt", $aURLs)
$ieObj = _IECreate($aURLs[1])
For $i = 2 To $aURLs[0]
$test = _IEPropertyGet($ieObj, "locationurl")
MsgBox(0, "test", $test)
If StringInStr("twitter.com", $test) Then
MsgBox(0, "twitter", "Twitter is Current Page")
EndIf
;MsgBox(0, "next", "next")
_IENavigate($ieObj, $aURLs[$i])
Next
MsgBox(0, "done", "done")
EndFunc ;==>start
I have a txt file "sites.txt" with 1 url per line. If twitter is one of the sites i want it to do the if statement but i cant get it working correctly . Im getting the Url from $test = _IEPropertyGet($ieObj, "locationurl")
MsgBox(0, "test", $test) to display but
StringInStr("twitter.com", $test) isnt doing its job....