sabato 24 ottobre 2009

IE vbs robot Browser - reading key in text file

Read text file named "Cerca.txt

On Error Resume Next
DO
Set fso = WScript.CreateObject("Scripting.FileSystemObject")
Set file = fso.OpenTextFile( "Cerca.txt", 1, False, 0)
Do While file.AtEndOfStream <> True
set objExplorer=WScript.CreateObject("InternetExplorer.Application","objExplorer_")
objExplorer.navigate2("http://www.google.it")
objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.Left = 0
objExplorer.Top = 0
objExplorer.Visible = 1
Do Until
objExplorer.ReadyState=4
WScript.Sleep inti*100*Rnd()
Loop
objExplorer.Document.All.Item("q").Value = file.ReadLine
objExplorer.Document.All.Item("sa").Click
Do Until
objExplorer.ReadyState=4
WScript.Sleep inti*100*Rnd()
Loop
WScript.Sleep
inti*100*Rnd()
Loop
objExplorer.Quit
file.Close()
Set file=Nothing
Set fso=Nothing
inti = inti + 1
Loop Until inti = 1300
Wscript.Quit
 

Nessun commento:

Posta un commento