Solved

Cache web pages with VB?

Posted on 2004-08-28
3
159 Views
Last Modified: 2010-05-02
I want to go out and cache several URLs once a week. I have a table of URLs that I want to cache. What is the easiest way to do this? After I cache the pages, I have another app that will scan the page for text and put that into another table. Any suggestions?
Thanks John
0
Comment
Question by:johnmoed
3 Comments
 
LVL 4

Expert Comment

by:cachedVB
ID: 11923693
use inet to get the source and save it as a text file -.-...
0
 
LVL 8

Accepted Solution

by:
mladenovicz earned 250 total points
ID: 11924977
Try to use MSXML2.XMLHTTP40 to cache URLs

You will need reference to the Microsoft Scripting Runtime and Microsoft XMl 4.0

Option Explicit

Private Sub Command1_Click()
Dim oFSO    As New Scripting.FileSystemObject
Dim oStream As Scripting.TextStream
Dim xmlHttp As New MSXML2.XMLHTTP40

    xmlHttp.open "POST", "http://localhost/test.asp", False
    xmlHttp.send ""
    Text1.Text = xmlHttp.responseText

    Set oStream = oFSO.OpenTextFile("C:\test.html", ForWriting, True, TristateFalse)

    oStream.WriteLine (Text1.Text)

    oStream.Close

    Set oStream = Nothing
    Set oFSO = Nothing
    Set xmlHttp = Nothing

End Sub
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now