Xmine
(Fresh Scripter)
2004-12-06 05:32 PM
HTML to text dump

Anyone got a method to dump a loaded web site down to a .txt file. Either from "open" mode or just load it direct down to the file ?

Greetz
X-mine


Bryce
(KiX Supporter)
2004-12-06 06:27 PM
Re: HTML to text dump

you can do something like this.

Code:

$url = "http://google.com"

$XMLHTTP = createobject("microsoft.xmlhttp")
$XMLHTTP.open("GET", $url, not 1)
$XMLHTTP.send
$return = $xmlhttp.responsetext

? $return




Les
(KiX Master)
2004-12-06 06:31 PM
Re: HTML to text dump

Well... Bryce beat me to it but his does not write to a file.
Code:
BREAK ON

$http=createobject("microsoft.xmlhttp")
$http.open("GET","http://www.kixtart.org/default.htm",not 1)
$http.send
$html=$http.responsebody
$rc=Open(1,'c:\html.htm',5)
$rc=writeline(1,$html)
$rc=close(1)



Sealeopard
(KiX Master)
2004-12-07 06:01 AM
Re: HTML to text dump

There's even a UDF for that: ReadHTML() - Retrieve Web page via XMLHTTP

LonkeroAdministrator
(KiX Master Guru)
2004-12-07 08:03 AM
Re: HTML to text dump

cool...
default.htm is retrieved even though there is no such thing...