Autor Beitrag
N1m3
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 30


Borland Delphi 2005 Personal
BeitragVerfasst: Fr 23.06.06 19:02 
Hi zusammen

Ich möchte gerne Links aus einer Seite bzw. HTML Code parsen.

Zur Ausgabe habe ichs mir so vorgestellt: LinkName,LinkUrl;..

Muss ich jetzt den ganzen Code per Schleife um jedes <,>,// abparsen, oder gibts da bereits Funktionen? Habe in Google noch nichts passendens gefunden und wollte mal hier fragen.

Lieben Gruss
Bernhard Geyer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 721
Erhaltene Danke: 3



BeitragVerfasst: Fr 23.06.06 19:17 
Ein guter Suchbegriff ist MSHTML und verwendung des MS IE.
rizla
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 417
Erhaltene Danke: 2

XP
FPC mit Lazarus
BeitragVerfasst: Fr 23.06.06 19:21 
ich hab das mal gemacht, allerdings musst ich wirklich die einzelnen strings parsen und nach entsprechenden urls suchen. hatte ein tool geschrieben, um interessante urls aus einer langen liste zu kristallisieren :zwinker:
:rizla:

_________________
if you have what they want - they'll find a way to take it (bruce sterling)
WOW - 10 JAHRE Mitglied beim Delphi-Forum. Wie die Zeit vergeht, Freunde.
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Fr 23.06.06 19:29 
Such mal nach Suche in der Entwickler-Ecke COPY(); und Suche in der Entwickler-Ecke POS(); oder Suche in der Entwickler-Ecke EXPLODE();

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
N1m3 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 30


Borland Delphi 2005 Personal
BeitragVerfasst: Fr 23.06.06 19:41 
Die einzelnen Funktionen von Delphi habe ich auch als Alternative gedacht. Aber das geht bei einer Scheife sehr sehr lange :(
Bernhard Geyer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 721
Erhaltene Danke: 3



BeitragVerfasst: Fr 23.06.06 19:43 
user profile iconGTA-Place hat folgendes geschrieben:
Such mal nach Suche in der Entwickler-Ecke COPY(); und Suche in der Entwickler-Ecke POS(); oder Suche in der Entwickler-Ecke EXPLODE();

Und was machst Du mit Sonderzeichen und den unterschiedlichen Codierungen von HTML-Seiten? Die LinkURl ist davon (außer man hätte schon eine Puny-Codierte URL) nicht betroffen aber der Text sehr wohl.
rizla
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 417
Erhaltene Danke: 2

XP
FPC mit Lazarus
BeitragVerfasst: Fr 23.06.06 19:53 
tja, darum parsen und suchen :wink:
was anderes machen die shdoc.dll ja auch nicht
:rz:

_________________
if you have what they want - they'll find a way to take it (bruce sterling)
WOW - 10 JAHRE Mitglied beim Delphi-Forum. Wie die Zeit vergeht, Freunde.
Bernhard Geyer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 721
Erhaltene Danke: 3



BeitragVerfasst: Fr 23.06.06 19:59 
user profile iconrizla hat folgendes geschrieben:
tja, darum parsen und suchen :wink:
was anderes machen die shdoc.dll ja auch nicht

Stimmt. Aber die Chance ist größer auch MS-"Standardverhunzte" Links zu erkennen. Auch wenn es auch welche gibt die man über MSHTML auch nicht bekommt obwohls der IE erkennt (MS-HTML erweiterungen).
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: So 25.06.06 08:00 
user profile iconN1m3 hat folgendes geschrieben:
Die einzelnen Funktionen von Delphi habe ich auch als Alternative gedacht. Aber das geht bei einer Scheife sehr sehr lange :(

Eventuell ist ja gar keine Schleife nötig. Was für Seiten möchtest du denn parsen?

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
matze.de
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 576

Win95, Win98 SE, WinXp Prof SP2
D7P, D8P, FPC2.0
BeitragVerfasst: So 25.06.06 09:36 
Ich würd ja Reguläre Ausdrücke benutzen :) Hier nen kleines Beispiel:
ausblenden Quelltext
1:
"/\<a[^\>]*href\=\"([^\"]*)\"[^\>]*\>([^\>]*)\<\/a\>/si"					
Brauchst aber ne extra Komponente (TRegExp) für.

mfg matze

_________________
si tacuisses, philosophus mansisses.