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


VB5 Internet Question

Posted on 1998-08-31
Medium Priority
Last Modified: 2010-04-30
Was wondering if anyone can help to point me in the right direction with this project:

I need my app created in VB5 to look in a database for a list of URLs.  Take each URL, one by one, and look in the source code of that URL's site for a specific word, then record for each URL, whether or not that keyword was found, then move to the next til the end of the list is reached.  If the URL can't be loaded, then the app would move to the next one, maybe in a certain time.

I'm game for using an ActiveX control, or anything for that matter.  Any help would be appreciated.  Points will be awarded to the person who give the most detailed help/instructions.. Thanks!
Question by:EvanL
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
  • 4
  • 2

Expert Comment

ID: 1432145
You can use the Microsoft INET ActiveX control to retrieve files via the web using http or ftp. The files and doc are available for download from the MSDN. Look for the internet sdk.

Dim sHtml as string
sHtml = MDIForm1.Inet1.OpenURL("http:\\whatever")

The value is returned to sHtml since the OpenURL method is not Asynchronous, so be certain to set the RequestTimout parameter. You can, however, check the StateChanged event for results and retieve data in chunks...

Private Sub Inet1_StateChanged(ByVal State As Integer)
        Dim sDtTm As String, rc As Integer
        Select Case State
        Case 11 'icError
            'Error processing here
            Exit Sub
        Case 12 '
            sData = Me.Inet1.GetChunk(length, 0)
        Case Else
            'interim "handshake" stuff explained in doc
        End Select
End Sub

Then use the InStr function to look for your keywords.

good luck

Author Comment

ID: 1432146
AJElcocks:  Thanks for the info.. I'm opening the question for a few different suggestions, but will award points to the best, most comprehensive answer.  I'm only going to keep it open for maybe 5-7 more replies, then get the person with the best answer to re-submit theirs as an answer.


Author Comment

ID: 1432147
A question.. I know how to get a webpage using the Inet control, but not just the source code (which is all I need).  I don't need a visual page, but the HTML behind it.

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Accepted Solution

AJElcocks earned 400 total points
ID: 1432148
Open a new project in VB then right click on the toolbox. Select "Microsoft Internet Transfer Control" (NOT Microsoft Internet Controls) and click OK.

Put two text box controls on a form. Keep text1 as single line, make Text2 multiline.

Place the following code in the form...

Private Sub Text1_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        RichTextBox1.Text = Inet1.OpenURL(Text1.Text, 0)
    End If
End Sub

Run the project, key "" in Text1 and press enter. You will see the source code in text2.

Author Comment

ID: 1432149
A question.. I know how to get a webpage using the Inet control, but not just the source code (which is all I need).  I don't need a visual page, but the HTML behind it.


Author Comment

ID: 1432150
AJElcocks: Thanks for the perfect reply..  Any additional info you might have on this topic would be greatly appreciated..


Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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 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…
Suggested Courses

715 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