Solved

advice

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

770 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