Autor Beitrag
Leuchtturm
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Do 22.06.06 14:32 
Hi,
weiß jemand von euch welche Indykomponente ich nehmen muss um den Text einer Website(html oder php) in einem RichEdit anzuzeigen.
Vielen Dank im Voraus.
Leuchtturm

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: Do 22.06.06 14:45 
Mit idHTTP kannst du den Text runterladen

_________________
Programmers never die, they just GOSUB without RETURN
Leuchtturm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Do 22.06.06 14:49 
Danke

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
Leuchtturm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Do 22.06.06 14:56 
Hat noch jemand ein umfangreicheres Tutorial als das bei dsdt für die idHttp-Komponente????

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
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 22.06.06 14:58 
so viel gibts doch da gar nicht zu wissen. was willst du denn genau wissen ?
Leuchtturm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Do 22.06.06 15:05 
Das hier habe ich bei dsdt gefunden:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.Button1Click(Sender: TObject);
var responseStream: TFileStream;
begin
  responseStream := TFileStream.Create(fmCreate);
  IdHTTP1.Get('http://de.wikipedia.org/wiki/Hallo', responseStream);
  responseStream.free;
end;

wenn ich aber auf den Button klicke kommt eine Fehlermeldung:
Zitat:
Fehler bei Bereichsprüfung

Was ist da falsch?
Leuchtturm

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
Leuchtturm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Do 22.06.06 15:23 
Wenn ich das so mache:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.Button1Click(Sender: TObject);
var responseStream: TFileStream;
begin
  IdHTTP1.Get('http://de.wikipedia.org/wiki/Hallo');
  responseStream.free;
end;

dann startet das Programm, ich kann auf den Button klicken, meine Firewall fragt mich um Erlaubnis ob dass das Programm ins Internet darf, und dann verschwindet der Button und kommt nicht mehr wieder

Wenn ich eine HTML-Datei(aus dem Internet), die in das RichEdit passt, lade kommt immer:
Zitat:
HTTP/1.1 404 Not Found

Wo ist jetzt mein Fehler :?: :?:

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
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 22.06.06 15:25 
du solltest auch einen Pfad angeben, unter dem die Datei gepeichert werden soll.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
var responseStream: TFileStream;
begin
  responseStream := TFileStream.Create('c:\text.txt',fmCreate);
  IdHTTP1.Get('http://de.wikipedia.org/wiki/Hallo', responseStream);
  responseStream.free;

An den HTML Quelltext kommst du aber auch leicher:
ausblenden Delphi-Quelltext
1:
memo1.text := IdHTTP1.Get('http://de.wikipedia.org/wiki/Hallo');					
Leuchtturm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Do 22.06.06 15:37 
Danke es funzt so.
Aber ich glaube ich habe mich undeutlich ausgedrückt ich will nicht den Quelltext sondern das im Screenshot rot markierte in dem RichEdit anzeigen lassen.
Trotzdem Danke
Einloggen, um Attachments anzusehen!
_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Do 22.06.06 15:39 
Und vergiss nicht HandleRedirects auf True zu setzen (was deinen 404er betrifft.)

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
Leuchtturm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Do 22.06.06 15:44 
Danke,
aber den 404er hab ich auch so hinbekommen,
weißt du wie man das hinbekommt das man das Stück der Seite die im Screeshot rot markiert ist in das RichEdit bekommt :?:

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Do 22.06.06 15:50 
Nun du wirst wohl dir den Quelltext ansehen müssen, und schauen, ob du regelmäßigkeiten in Wikipedia findest, nach denen du per pos&copy den Text bekommen kannst. Um den HTML Quelltext wirst du wohl nicht rum kommen, das heist du musst den Text manuell parsen oder eben einen Parser verwenden. (z.B. TWebBrowser)

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
Leuchtturm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Do 22.06.06 15:56 
geht auch der JvHTMLParser

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.