Fosco
Sat Sep 16 01:03:30 CDT 2006
"Larry"
I have just posted this in an oth er NG .. check it out :
x = TextFromHTML("
http://"& _
"www.televideo.rai.it/televideo/pub/archiviopagine.jsp")
'WScript.Echo x
Function TextFromHTML(URL)
set ie = createobject("InternetExplorer.Application")
ie.navigate URL
do until ie.readystate = 4 : wscript.sleep 10: loop
TextFromHTML = ie.document.body.innerText
ie.quit
End Function
filename = "Televideo.txt"
Set fso = CreateObject("Scripting.FileSystemObject")
Set newf = fso.createtextfile(filename)
newf.WriteLine x
set oShell = CreateObject("WScript.Shell")
while not FSO.FileExists("Televideo.txt")
WScript.Sleep 100
Wend
oShell.run"Televideo.txt"
' same as above but parsed
' Avevo un po' di tempo e curiosita' di provare 'na cosa :
' siccome NON so se la pagina e statica o no per affinare
' diminuire o aumentare >> For i = 0 To 41
x = TextFromHTML("
http://"& _
"www.televideo.rai.it/televideo/pub/solotesto.jsp")
'WScript.Echo x
'x = TextFromHTML("C:\WINDOWS\Desktop\Rai televideo\Rai_it - Televideo.htm")
'WScript.Echo x
Function TextFromHTML(URL)
set ie = createobject("InternetExplorer.Application")
ie.navigate URL
do until ie.readystate = 4 : wscript.sleep 10: loop
TextFromHTML = ie.document.body.innerText
ie.quit
End Function
filename = "Televideo.txt"
Set fso = CreateObject("Scripting.FileSystemObject")
Set newf = fso.createtextfile(filename)
newf.WriteLine x
set oShell = CreateObject("WScript.Shell")
Msgbox SkipLineInFile
Function SkipLineInFile
Const ForReading = 1, ForWriting = 2
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
' Set f = fso.OpenTextFile("c:\testfile.txt", ForWriting, True)
' f.Write "UNO" & vbCrLf & "DUE"& vbCrLf & "TRE" & vbCrLf &"Ciao"
Set f = fso.OpenTextFile("Televideo.txt", ForReading)
For i = 0 To 41
f.SkipLine
Next
SkipLineInFile = f.ReadAll
End Function
filename = "Televideo2.txt"
Set fso = CreateObject("Scripting.FileSystemObject")
Set newf = fso.createtextfile(filename)
newf.WriteLine SkipLineInFile
while not FSO.FileExists("Televideo2.txt")
WScript.Sleep 100
Wend
oShell.run"Televideo2.txt"
--
Fosco