1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
   | Const TriStateTrue = -1 ' Pour la prise en charge de l'Unicode
URL = InputBox("Entrez l'URL pour y extraire son Code Source HTML "&vbcr&vbcr&_
"Exemple ""http://www.google.fr""","Extraction du Code Source © Hackoo © 2013","http://www.google.fr")
If URL = "" Then WScript.Quit
Titre = "Extraction du Code Source de " & URL
Set ie = CreateObject("InternetExplorer.Application")
Set objFSO = CreateObject("Scripting.FileSystemObject")
ie.Navigate(URL)
ie.Visible=false
DO WHILE ie.busy
LOOP
DataHTML = ie.document.documentElement.innerHTML
strFileHTML = "CodeSourceHTML.txt"
Set objHTMLFile = objFSO.OpenTextFile(strFileHTML, 2, True, TriStateTrue)
objHTMLFile.WriteLine(Titre&vbcr&String(120,"*"))
objHTMLFile.WriteLine(DataHTML)
objHTMLFile.Close
ie.Quit
Set ie=Nothing
 Ouvrir(strFileHTML)
wscript.Quit
 
Function Ouvrir(File)
Set ws=CreateObject("wscript.shell")
ws.run "Notepad.exe "& File,1,False
end Function | 
Partager