Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using VB to download HTML page.

Posted on 2002-06-03
4
Medium Priority
?
167 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 143

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 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 200 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

688 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