Find "Invalid","
Function Find(StrString,URL)
Titre = "Find a String in a webpage"
'URL = "
Set ie = CreateObject("InternetExplorer.Application")
Set objFSO = CreateObject("Scripting.FileSystemObject")
ie.Navigate(URL)
ie.Visible = 1
DO WHILE ie.busy
wscript.sleep 100
LOOP
wscript.sleep 1000
Set WshShell = WScript.CreateObject("WScript.Shell")
'WshShell.AppActivate"Browser Logon"
ie.Navigate(URL)
wscript.sleep 1000
With ie.Document
.getElementByID("userName").value = "h"
.getElementByID("password").value = "h"
End With
wscript.sleep 1000
Set oInputs = ie.document.getElementsByTagName("input")
For Each elm In oInputs
If elm.Value = "Logon" Then
elm.Click
Exit For
End If
Next
wscript.sleep 5000
Data = ie.document.documentElement.innertext
Set ie = Nothing
Set objRegex = new RegExp
objRegex.Pattern = StrString
objRegex.Global = False
objRegex.IgnoreCase = True
Set Matches = objRegex.Execute(Data)
For Each Match in Matches
'MsgBox "We found this word : " &vbCr& qq(Match.Value) & "in " & URL,64,Titre
Set MyApp = CreateObject("Outlook.Application")
Set MyItem = MyApp.CreateItem(0)
With MyItem
.To = "my email"
.Subject = "Found invalid"
.ReadReceiptRequested = False
.HTMLBody = ""
End With
MyItem.Send
Next
End Function
Function qq(strIn)
qq = Chr(34) & strIn & Chr(34)
End Function
Function Pause(NbMin)
wscript.sleep NbMin*1000*60
End Function