Solved

advice

Posted on 2002-06-26
5
123 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
ID: 7110508
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
ID: 7111895
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
ID: 7112664
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
ID: 7114336
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
ID: 7115047
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

910 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

23 Experts available now in Live!

Get 1:1 Help Now