Solved

advice

Posted on 2002-06-26
5
125 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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
code issue 8 156
Connection between libmysql.dll and MySQL Versions 7 113
Not able to call Delphi XE10 dll function from Delphi 6.0 4 37
Wincontrol not (correctly) drawn 15 42
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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

830 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