How To Know That A Web Page Has Changed
Description
You want to know that the content of a web page changes without having to see it.
Solution.
In the following example we are going to create a script that will download the web page:
http://www.microsoft.com/windows/internet-explorer/
and look for the string “Internet Explorer 8”. Only will show a message when the web changes.
We are going to use wget:
http://www.interlog.com/~tcharron/wgetwin-1_5_3_1-binary.zip
1. First extract wget to ‘c:\utils’ .
2. Copy the following text into a new notepad:
Dim obj_Shell
Dim objFSO
Dim lineaActual
textToFind = "Internet Explorer 8"
webToSearch = "http://www.microsoft.com/windows/internet-explorer/"str = "(.+)" & textToFind & "(.+)"
Set obj_Shell = CreateObject("Wscript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
obj_Shell.Run "cmd /c c:\\utils\\wget.exe -e robots=off -O c:\\utils\\web.file " & webToSearch ,0 ,true
Set file = objFSO.OpenTextFile("c:\\utils\\web.file", 1 )
line=""
While not file.AtEndOfStream
line=line & file.ReadLine
Wend
Set procesStr = New RegExp
procesStr.IgnoreCase = True
procesStr.pattern = str
Set matches = procesStr.Execute( line )
If matches.Count=0 Then
WScript.echo "Not Found"
End Ifobj_Shell.Run "cmd /c del c:\\utils\\web.file",0 , true
3. Save as “c:\utils\web.vbs” recall to use the “.
4. Create a new task as is explained in this post, to allow for the script to repeat since the time you want.
Related posts: