Autor Beitrag
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Do 15.07.10 09:29 
Hallo.

Ich stand vor kurzem vor der Aufgabe, dass ich an ein bestimmtes Element in einer HTML Seite zugreifen musste. Das war allerdings ein PHP Projekt. Durch meine Recherche fand ich folgende Lib: simplehtmldom.sourceforge.net/ Hier kann man eine HTML Seite zerlegen und dann mit einer jQuery-artigen Notation (fast wie CSS) auf die einzelnen Tags zugreifen.

Meine Fragen:
Wie mache ich so was in Delphi?
Gibts da eine fertige Unit für sowas, die das gleiche leistet wie diese PHP Lib?
Könnte man diese PHP Lib nach Delphi portieren und wie viel Aufwand wäre das?

Danke!
Matze

_________________
In the beginning was the word.
And the word was content-type: text/plain.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Do 15.07.10 11:27 
Such mal nach XPath.

Die DP meint dazu: www.delphipraxis.net...at-hat-die-qual.html

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: Do 15.07.10 11:32 
jQuery macht aber kein XPath, sondern CSS3-Selectoren. Die kann XPath teilweise nicht.

Musst du aber selber suchen :P


XPath hat allerdings den Vorteil, dass es auf beliebigem XML definiert ist und daher wohl einfacher irgendwo zu finden ist. MSXML müsste das eigentlich können. Hoffe ich mal.

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
matze Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Do 15.07.10 15:49 
ja das ist ja das Problem. XPath ist nur für XML. Nicht unbedingt für HTML.
Zudem ist via XPath das ganze nicht so abfragbar wie per CSS/jQuery-Syntax.

Es kennt also keiner eine vergleichbare Unit für Delphi?

Wie schauts denn mit dem portieren aus? Wie schätzt ihr da den Aufwand ein?

_________________
In the beginning was the word.
And the word was content-type: text/plain.