Solved

IE's find

Posted on 2003-11-10
7
197 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
  • 4
7 Comments
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
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
Comment Utility
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
Comment Utility
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 49

Accepted Solution

by:
DanRollins earned 250 total points
Comment Utility
>> 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
Comment Utility
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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
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.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now