Solved

IE's find

Posted on 2003-11-10
7
199 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
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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
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 clear a vector as well as how to detect empty vectors in C++.

813 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

16 Experts available now in Live!

Get 1:1 Help Now