IE's find

Hi,
Does anyone know how to implement Internet Browser's Find ? What i need is to write an application that displays a web page but i want the application to automatically find the string that i want. For example, a page that has a list of products sorted alphabetically and normally, to find a product on that page, we use IE's Find to find the string that we want. What i want to do is write an application that gets only the product's price that i want and show it on an edit box. I tried using the raw HTML data that i obtain from the page but the problem is that on certain page, it's doesn't show all the raw HTML data. Thanks.
Hsiang2kAsked:
Who is Participating?
 
DanRollinsCommented:
>> even using view source, it doesn't show all the HTML code and the product string is not in the html.

If it is not in the HTML, then where is it?  
If you can't see it in View Source, then I don't know how you can even get started with your task.

Please provide a URL or a complete description of the data you can see in the browser and the data that you need to obtain for your program.

>> What about MS Web browser ?
Yes, you can use this.  I assumed that you knew how to do that, but I can show you how.  However, we can't even start on that process without *first*  being able to pinpoint the desired data by looking at View Source.

-- Dan
0
 
DanRollinsCommented:
I think you are talking about what is commonly known as "screen scraping" (for obscure historical reasons).  THis is a very common need and fortunatley is it very easy to do.

1) You need to get access to the HTML as a string of text in a variable in memory.  That is easy to do and from your question, it sounds like you know how to do that.  If you need help, just ask.

2) You next need to locate what I call a "sentinel" -- a piece of text that is unique but is very near to the text that you actually want.

To locate a sentinel, browse the page asn use the View Source context menu command.   You will almost certainly see some unique string of characters.  For instance:

      <TD align=right>Price:</TD> <TD>12.34</TD>

here a string such as
      "=right>Price:"
is your sentinel.  

3) Now just search your HTML string for that sequence.  Parse forward a few characters a viola!  ther is the text you need.

If you need more help, just ask.

-- Dan


0
 
DanRollinsCommented:
If from examining the View Source, you can determine that the datum you want has a name or ID, then there is another way.  Let me know...
-- Dan
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Hsiang2kAuthor Commented:
Hi,
 The problem is that on some page, even using view source, it doesn't show all the HTML code and the product string is not in the html. if i go to a page that give me all it's HTML code, then i'll have no problem finding the string that i want.
What about MS Web browser ? That active x can show the page like IE but the problem is how to get the string that i want from the active x's display. Thanks.
0
 
DanRollinsCommented:
hi Hsiang2k,
Do you need more help?  Please communicate with the Experts who are helping you.  Thanks!
-- Dan
0
 
tinchosCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: DanRollins {http:#9723880}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Tinchos
EE Cleanup Volunteer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.