brainware
asked on
Retrive info from HTML
Hi
I desperate need a solution to retrive the value/string from a table on a certin website,
does not need to be fast parsing the html-code.
Example Pages:
http://www.edbpriser.dk/hardware/hardware-top10.asp?ID=1244578020
http://www.edbpriser.dk/hardware/hardware-top10.asp?ID=1364577995
What i need to retrive is the first number below TOTAL eg 3.122 kr
bet some of you string parsing master have a solution ;)
Thanks
Michael
I desperate need a solution to retrive the value/string from a table on a certin website,
does not need to be fast parsing the html-code.
Example Pages:
http://www.edbpriser.dk/hardware/hardware-top10.asp?ID=1244578020
http://www.edbpriser.dk/hardware/hardware-top10.asp?ID=1364577995
What i need to retrive is the first number below TOTAL eg 3.122 kr
bet some of you string parsing master have a solution ;)
Thanks
Michael
do the htmlsource in Memo1 then you will get it in Edit1
procedure TForm1.Button1Click(Sender : TObject);
var i:integer;
begin
for i:=0 to Memo1.Lines.Count do
begin
if Pos('bedominfo.asp',Memo1. Lines.Stri ngs[i])<>0 then
begin
Edit1.Text := copy(Memo1.Lines.Strings[i +9],Pos('> ',Memo1.Li nes.String s[i+9])+1, Pos('</',M emo1.Lines .Strings[i +9])-2-Pos ('>',Memo1 .Lines.Str ings[i+9]) );
break;
end;
end;
end;
procedure TForm1.Button1Click(Sender
var i:integer;
begin
for i:=0 to Memo1.Lines.Count do
begin
if Pos('bedominfo.asp',Memo1.
begin
Edit1.Text := copy(Memo1.Lines.Strings[i
break;
end;
end;
end;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks all, Im looking at all of your examples,
ASKER
very nice scanning methods,
can even use this for some other things too, very nice.
Thanks a lot
can even use this for some other things too, very nice.
Thanks a lot
I recoment you pay a visit to about.delphi.com and search for something called HTML File Scraping. They have a ready built example of how to retrieve certain elements from a HTML-file.
Just try to find distinctive patterns between which you can extract the data you want. Fo example, you can ditch everything from the beginnig to this point:
href="hardware-top10.asp?I
First, work in notepad to find the patterns and then try to implement it by the examle from about.com
It's certainly not the best way to do this but it's one way...
Hope this helped you a bit on the way!