Home > Uncategorized > How To Know That A Web Page Has Changed

How To Know That A Web Page Has Changed

November 5th, 2009 Angel Leave a comment Go to comments

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 If

obj_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:

  1. Internet Explorer Open In A Small Window
  2. Desktop Icon Missed From Quick Launch
  3. How To Execute A Program With Other User Not Showing The Password
  4. Moving a File That Is Being Used
Categories: Uncategorized Tags:
  1. No comments yet.
  1. No trackbacks yet.