Solved

Using VB to download HTML page.

Posted on 2002-06-03
4
163 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 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel VBA, find a string in a column, update a cell 7 116
SQL VB connection works in one PC and doesn't in another 15 79
MsgBox 4 75
Set WorkSheet  not Working 9 62
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…

738 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