Solved

advice

Posted on 2002-06-26
5
126 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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 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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

738 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