Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6 Saving HTML Source to a File

Status
Not open for further replies.

Herzog

Programmer
Dec 1, 2003
3
US
Hello people,
I just started learning Visual Basic 6 last week and need some help with the 'learning curve' I am currently suffering. I would really appreciate if someone could help me.

I need to make a VB6 program that, among other things, can access a website and save the HTML source code for parsing. I can deal with the parsing but have no idea how to get started with the connect-open web-post-save procedure.

Can someone give me some pointers as to how to get started or what information to look for¿? Or maybe some common examples of similar codes on the web¿?

Thanks in advance,
herzog
 
>I just started learning Visual Basic 6
>access a website and save the HTML source code for parsing

Um, whilst this is not particularly difficult, there is a question to be asked about the difference between running and walking...
 
Herzog
Welcome to Tek-Tips, to get the most from this site, Please read FAQ222-2244

Here's one way you can get the html and save it..

You need to add a reference to the Microsoft Internet Transfer Control. Goto Project->Components, and select the above component.

Now draw a new Inet control onto your form (Now found in the toolbox after referencing the component), add a command button and the following code..

Private Sub Command1_Click()
Dim b() As Byte
Dim intFree As Integer

b() = Inet1.OpenURL(" icByteArray)

intFree = FreeFile

Open App.Path & "\test.htm" For Binary Access Write As #intFree
Put #intFree, , b()
Close #intFree
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top