?
Solved

Collecting Data from an active IE Browser

Posted on 2003-02-19
9
Medium Priority
?
176 Views
Last Modified: 2010-04-07
I am working on a VB application.  I want my application to be able to search the contents of a web page displayed in an active IE browser (that will also be open when running the VB app) and find an instance of a string that has the % sign in it.  I will then pass this to a variable and do what I need.  I have never done any VB work with searching data in a browser.  That is what I need help with. How could I do this?  I am open to ideas.  Maybe I have to make a browser a part of the VB app so I can get to it that way instead of the browser being separate from the VB app.

Thanks in advance!
0
Comment
Question by:Randy2002
[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
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 18

Accepted Solution

by:
Sethi earned 600 total points
ID: 7985176
there are two ways to deal with IE in VB:
1. In case you want the browser to open within your Vb application then use Webbrowser control.
2. In case you want to run a seperate instance of browser then use Internet Explorer object library.

Once you have created an instance of IE you can access the document object of the IE object and this document object has the property named innerText that will give you access to the source of the page displayed by IE.

See some projects in planet-source-code.com for better understanding of how it works. Or you can see this link where Micrsoft has explained each and everything in detail:
http://msdn.microsoft.com/library/default.asp?url=/nhp/Default.asp?contentid=28000441
0
 

Assisted Solution

by:belcalan
belcalan earned 600 total points
ID: 7985214
You could use the WebBrowser control in VB, a good starter on that is here: http://www.vbweb.co.uk/show/18/1/

Then use the document property to access the html document contained see: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnie40/html/msdn_lassesen.asp

ie the WebBrowser1.Document.Body.innerHTML property shows all the html of the current page
0
 

Author Comment

by:Randy2002
ID: 7990317
Thanks for the input so far.  I will play around with this and get back with you.
0
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!

 

Author Comment

by:Randy2002
ID: 7990718
Well, I am halfway there.  I got a browser control in the form and can do some stuff with it.

Feel like I am drilling oil in documentation to do the string search part I mentioned though.
0
 
LVL 18

Assisted Solution

by:Sethi
Sethi earned 600 total points
ID: 7992225
Yes its a very vast object library. If you know some scriptiong language like JavaScript or VBScript then the whole object heirarchy works like that.
0
 

Assisted Solution

by:belcalan
belcalan earned 600 total points
ID: 8004616
the WebBrowser1.Document.URL will give you the url, from that you can use

dim url, query as string
dim haspercent as boolean
url = WebBrowser1.Document.URL
query = right(url, len(url) - instr(1 ,url, "?"))
haspercent = (instr(1, query, "%") > 0)

to find if the % is in the query string
0
 

Expert Comment

by:CleanupPing
ID: 8901412
Randy2002:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
0
 
LVL 18

Expert Comment

by:Sethi
ID: 8910946
Recommendation: Split points between  belcalan & Sethi
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8959731
Moderator, my recommended disposition is:

    Split points between: Sethi and belcalan

DanRollins -- EE database cleanup volunteer
0

Featured Post

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.

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…
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…
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…
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…
Suggested Courses
Course of the Month15 days, 8 hours left to enroll

743 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