HTML Output in eine txt Datei mit VisualBasicScript
Ich habe ein html link der eine Seite öffnet, doch der Output der da raus kommt möchte ich in eine Textdatei schreiben. Geht das in vbs und wenn ja, könnte mir das jemand erklären, Bitte. Danke
Wenn jemand einen anderen Weg kennt, ich bin für Vorschläge offen.
Wenn jemand einen anderen Weg kennt, ich bin für Vorschläge offen.
Please also mark the comments that contributed to the solution of the article
Content-Key: 322622
Url: https://administrator.de/contentid/322622
Printed on: May 5, 2024 at 01:05 o'clock
2 Comments
Latest comment
Dazu gibt's im Web zig Beiträge.
vbscript read html webpage text
vbscript read html webpage text
result = DownloadFile("https://administrator.de","D:\daten\administrator-webpage.txt")
if result then
msgbox "Download erfolgreich abgeschlossen"
else
msgbox "Download-Fehler!",vbExclamation
End if
Function DownloadFile(strURL, strTarget)
Dim objhttp,objStream
Set objhttp = CreateObject("Microsoft.XMLHTTP")
Set objStream = CreateObject("ADODB.Stream")
With objhttp
.Open "GET", strURL, False
.send
If .Status = 200 Then
objStream.Open
objStream.Type = 1
objStream.Write .responseBody
objStream.SaveToFile strTarget, 2
objStream.Close
DownloadFile = True
Else
DownloadFile = False
End If
End With
End Function