Solved

Using VB to download HTML page.

Posted on 2002-06-03
4
159 Views
Last Modified: 2010-05-02
In Visual C++ I know how to connect to an HTTP server and download a given page. I usually declare an internet file object, do the necessary connections and then read through the file line by line.

How would I accomplish this in Visual Basic? I need some example code, please, for a function that might take in a URL, connect to it, and then read through the source code line by line.

(This is for data mining purposes, by the way. I chose VB over VC++ because of better string handling capability).

Thanks very much!

-Dan

0
Comment
Question by:SuperMario
  • 2
4 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 7051347
VB better than VC for string handling ???? Please note that i'm VB but i think VC is stronger for strings.

Anyway, simply put an INet control to your form, and do an OpenURL ( htmladdress ) to retrieve the data.

CHeers
0
 
LVL 18

Expert Comment

by:bobbit31
ID: 7051351
you can use the webbrowser control to do this:

WebBrowser1.Navigate "http://www.microsoft.com"
While WebBrowser1.Busy
    DoEvents
Wend
MsgBox WebBrowser1.Document.body.innerHTML

or
msgbox webbrowser1.document.body.innertext
0
 
LVL 3

Author Comment

by:SuperMario
ID: 7051365
Where can I find these controls?
0
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 50 total points
ID: 7051376
Menu Project
 -> Components
   -> check "Microsoft Internet Controls" (web browser)
   -> check "Microsoft Internet Transfer Controls" (inet)
  OK
see the components in the component toolbar

CHeers
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

706 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

19 Experts available now in Live!

Get 1:1 Help Now