Solved

advice

Posted on 2002-06-26
5
122 Views
Last Modified: 2010-04-04
Hello,

One of my client ask me to build application that taking the data from a web site .

I think that the generl idea is to make some parsing on html.
My question: what is the best way to do it ? how ?

thank u
Asi
0
Comment
Question by:asi
5 Comments
 
LVL 12

Expert Comment

by:Lee_Nover
Comment Utility
I'd use Indy TidHTTP
retrieve the site, then do some parsing on it
depends what kind of data you need from that site
give more details
0
 
LVL 5

Expert Comment

by:Gwena
Comment Utility
Just download the html file in question and get it into a string... then use all the delphi string routines to parse it and look for the data you are interested in.

There are several freeware components and units that will let you download a web page...

http://www.nevrona.com/Indy/

http://www.ararat.cz/synapse/

http://www.rtfm.be/fpiette/indexuk.htm


that last link is to fpiettes great internet component suite...but for some reason I am getting a 404 error when trying to access it??? maybe he moved it or lost interest :-(

I have a couple of demos on my site that download a web page and add the text to the end of the running exe... not at all what you want but the source will show you how to dl a web page at least... I used synapse in one and ICS in the other..you could just modify my demos since the html is converted to a string before I add it to the exe... just parse the string and extract the data you want to see.. then forget about adding it to the end of the exe :-)

http://www.geocities.com/gacarpenter386/

p.s. I think synapse is easiest to use... I like that it is just units and not a bunch of components to install.. I never was able to install the Indy components in D6 personal so I have no idea how well it works.

..Gwen..

0
 
LVL 1

Expert Comment

by:VENKAT
Comment Utility
Get this followed HTML Delphi component and so that u can read HTML files. So first u need to save ur WebPages into HTML files.

Component name is "TGLHTMLTable"
0
 

Author Comment

by:asi
Comment Utility
In general does this way is safe at all ? after all web pages can be change !
0
 
LVL 5

Accepted Solution

by:
Gwena earned 50 total points
Comment Utility
Yes web pages do change .. and a program that parses data inside the html of the changed page can be left brainless.

The best way to handle this is to have a web page of your own that contains parsing info for your programs... this way when a page changes you can post new data that will inform your programs of the changes and how to cope with them.

If the changes are HUGE then you can have your program download a new version of itself and rebuild itself on disk (see my demos to get an idea of how this might be done)


My httpalterdemo shows how placing data on a web site as text that is embeded inside the html can alter your programs exe file on disk at runtime... this page

http://www.geocities.com/gacarpenter386/test1.htm

contains this bit of text

<!--MyFormColor=%green% -->

the demo program parses the html and uses this data to change itself so that it will always start with a green colored form.  You can do something similar with parsing instructions...

Have your programs check your page first to see if they need new parsing instructions... then they can go ahead and grab the pages they want to parse :-)


hope this helps :-)
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 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

6 Experts available now in Live!

Get 1:1 Help Now