?
Solved

Getting data from webpage using WebBrowser

Posted on 2003-10-30
8
Medium Priority
?
190 Views
Last Modified: 2010-05-01
I'm trying to get data from a webpage into my VB app.  The department I'm in submits all of their defects in TeamTrack (this is the website).  We also need to list all these defects in some sort of defect log (my vb app).  I would like to catch all the info I need for the defect log when they submit the defect in teamtrack.  I messed around with another intranet site we use and I was able to get values from the site by using the document property of WebBrowser control - code: Text1.Text = WebBrowser1.Document.Forms("frm").lastname.Value  I'm having trouble with the TeamTrack website, and I think, but I'm not sure, it's because the TeamTrack website is in frames.  Any ideas on how I can do this?


I'm in the process of researching as I'm not sure of the best way to go about doing this. I came across the WebBrowser control so I'm trying to accomplish what I need to do with it.  If anyone has a simpliar or more efficient solution, please let me know.

Sorry this is so long.  Any help would be greatly appreciated.  Thank you in advance.
0
Comment
Question by:Sam8932
[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
  • 4
  • 3
8 Comments
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9652361
document object has a Frames property collection, you could use it to navigate each frame and get data as usually do (each frame is a document object itself)
0
 

Author Comment

by:Sam8932
ID: 9652539
Thanks Richie.  Could you provide an example (some code) if it's not too much trouble?  I would appreciate it.  

Thanks,
Sam
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9653125
Option Explicit

Dim WithEvents ie As InternetExplorer
Sub test()
Set ie = New InternetExplorer
With ie
    .navigate "C:\A_project\frames_main.htm"
    .Visible = True
End With
End Sub


Private Sub ie_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If (pDisp Is ie) Then
    Dim iedoc As HTMLDocument, f As Integer
   
    For f = 0 To ie.document.frames.Length - 1
        Set iedoc = ie.document
       
        Debug.Print iedoc.frames.Item(f).document.body.innerText
        Debug.Print "***************************************"
    Next f
End If
End Sub




0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:Sam8932
ID: 9722633
Richie,
I'm testing the code you listed above and I keep getting the error message 'Class does not support Automation or does not support expected interface'.  The error is occuring at the line 'Set ie = New InternetExplorer'.  Any suggestions?  I'm really struggling with this.  Again, I appreciate you help.  Thanks again.
0
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 360 total points
ID: 9722768
That code doesn't uses Webbrowser control but Internet explorer itself (the approach is the same).
i tested it and it works.
0
 

Author Comment

by:Sam8932
ID: 10164378
I've awarded the points to Richie for his help.  I'm sure his code works, but I've been pulled from the project and I'm unsure when I'll be working on it again.  I hope Richie (or someone) will be able to help when/if I begin to work on this problem again.  Thanks.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 10252482
You would be welcome anytime. Thanks for "A" grade.
0

Featured Post

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!

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month11 days, 15 hours left to enroll

752 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