[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Collecting Data from an active IE Browser

Posted on 2003-02-19
9
Medium Priority
?
177 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
  • 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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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

590 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