Copy elements to new file

  • Thread starter Thread starter JoJo
  • Start date Start date
J

JoJo

Hello:


I am looking for a script that I can use to extract specific pieces of
information from an HTML document.
My document is 100 pages long & is located at
http://www.geocities.com/boomerangtrades/Motherlode.htm

I like the idea of embedding a JavaScript into the HTML code, but I would
welcome any other type of solution.
I am trying to extract the titles of articles (that all begin with the ">>"
characters) and copy them to a new file.


Thanks,
JoJo
 
I am looking for a script that I can use to extract specific pieces of
information from an HTML document.
My document is 100 pages long & is located at
http://www.geocities.com/boomerangtrades/Motherlode.htm

I like the idea of embedding a JavaScript into the HTML code, but I would
welcome any other type of solution.
I am trying to extract the titles of articles (that all begin with the ">>"
characters) and copy them to a new file.

You could download the page with

Sub DownloadWithXMLHTTP (sSource,sDest)
'Download a file using activeX Object XMLHTTP
'and save to sDest using ADO Stream
set oHTTP = WScript.CreateObject("Microsoft.XMLHTTP")
oHTTP.open "GET", sSource, False
oHTTP.send
set oStream = createobject("adodb.stream")
Const adTypeBinary = 1
Const adSaveCreateNotExist = 1
Const adSaveCreateOverWrite = 2
oStream.type = adTypeBinary
oStream.open
oStream.write oHTTP.responseBody
oStream.savetofile sDest, adSaveCreateOverWrite
set oStream = nothing
set oHTTP = nothing
end sub

Where sSource is the url and sDest a filename where to put the htm page.

Then parse the file in search of the >>.
You could split the content and get the lines with >> using instr.
 
Back
Top