Autor Beitrag
neo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 179



BeitragVerfasst: Sa 25.10.03 23:59 
Hallo!

Wie bekomme ich alle Links uns Unterlinks einer INet Seite? (Wäre nicht schlecht wenn man Ebenen einstellen könnte.)

Danke!
MrSaint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1033
Erhaltene Danke: 1

WinXP Pro SP2
Delphi 6 Prof.
BeitragVerfasst: So 26.10.03 10:29 
was verstehst du unter "Unterlinks"? also wenn es die links von den seiten sind, die auf der ersten seite verlinkt werden, dann würd ich dir ne rekursive Funktion empfehlen, die eben alle <a> Tags raussucht und auswertet 8)


MrSaint

_________________
"people knew how to write small, efficient programs [...], a skill that has subsequently been lost"
Andrew S. Tanenbaum - Modern Operating Systems
neo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 179



BeitragVerfasst: So 26.10.03 12:40 
Titel: RE:
Genau diese Links meine ich.

Kannst du mir ein Beispiel schicken?
MrSaint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1033
Erhaltene Danke: 1

WinXP Pro SP2
Delphi 6 Prof.
BeitragVerfasst: So 26.10.03 12:51 
also ich mach dir hier ja nich die ganze arbeit, aber n bissle code kann ich dir ja geben ;)
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
function getAllLinks(from:string;tiefe:byte):TStrings;
var i:integer;
begin
  result:=TStringList.Create;
  if tiefe<=0 then exit;
  [ ... alle <a>-Tags finden und in result speichern ... ]
  i:=0;
  while (i<=result.count-1do 
  begin
    result.add(getAllLinks(result.strings[i],tiefe-1));
    inc(i);
  end;
end;


nicht getestet... geb also keine garantie ;)


MrSaint

[EDIT]: Quelltext geändert... war ne Endlos-Schleife drin...

_________________
"people knew how to write small, efficient programs [...], a skill that has subsequently been lost"
Andrew S. Tanenbaum - Modern Operating Systems