Solved

IE's find

Posted on 2003-11-10
7
201 Views
Last Modified: 2010-04-02
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.
0
Comment
Question by:Hsiang2k
[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
7 Comments
 
LVL 49

Expert Comment

by:DanRollins
ID: 9720784
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
 
LVL 49

Expert Comment

by:DanRollins
ID: 9720792
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
 

Author Comment

by:Hsiang2k
ID: 9721326
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
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!

 
LVL 49

Accepted Solution

by:
DanRollins earned 250 total points
ID: 9723880
>> 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
 
LVL 49

Expert Comment

by:DanRollins
ID: 9784169
hi Hsiang2k,
Do you need more help?  Please communicate with the Experts who are helping you.  Thanks!
-- Dan
0
 
LVL 9

Expert Comment

by:tinchos
ID: 10248870
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

Featured Post

Technology Partners: 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

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

738 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