Autor Beitrag
Chrischuh
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 124
Erhaltene Danke: 1

Win 7
Turbo Delphi
BeitragVerfasst: Di 04.11.08 19:00 
Hallo,

ich habe eine Seite mit der TWebbrowserkomponente geöffnet.
Jetzt möchte ich den Quelltext komplet in ein memo laden.

Wie geht das?

Habe schon mehrere Codes von anderen Seiten getestet, aber keiner hat funktioniert.

Chrischuh

edit: ausversehen falsche sparte
Andreas Schilling
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 128
Erhaltene Danke: 1

WIN XP, WIN 7
Delphi 5 Ent, Delphi 2007 Pro, XE4
BeitragVerfasst: Mi 05.11.08 07:52 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
  var htmlcode: string;

  htmlcode := WebBrowser1.OleObject.Document.Body.InnerHtml;

  Memo1.lines.add(htmlcode);
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19314
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 05.11.08 11:16 
Wobei ich für den Zweck eher TIdHttp empfehle, es sei denn die Seite soll dem Benutzer auch visuell angezeigt werden. Wenn du die Seite nur nonvisuell abrufen willst wäre TIdHttp einfacher, schneller und sauberer.
Chrischuh Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 124
Erhaltene Danke: 1

Win 7
Turbo Delphi
BeitragVerfasst: Do 06.11.08 16:42 
user profile iconAndreas Schilling hat folgendes geschrieben Zum zitierten Posting springen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
  var htmlcode: string;

  htmlcode := WebBrowser1.OleObject.Document.Body.InnerHtml;

  Memo1.lines.add(htmlcode);


es kommt zugrifffsverletzung

wie würde es mit idhttp gehen? ich kenne mich mit indy nicht aus.
nagel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 708

Win7, Ubuntu 10.10

BeitragVerfasst: Do 06.11.08 21:33 
ausblenden Delphi-Quelltext
1:
Code := IdHTTP.Get('http:// ... ');					
Chrischuh Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 124
Erhaltene Danke: 1

Win 7
Turbo Delphi
BeitragVerfasst: So 09.11.08 21:06 
was ist 'code'?
kann ich stattdessen auch memo1.lines verwenden?
es kommt immer die fehlermeldeung: maxlengh existiert nicht
was kann ich tun?
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19314
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: So 09.11.08 21:41 
user profile iconChrischuh hat folgendes geschrieben Zum zitierten Posting springen:
was ist 'code'?
Naja, das wo der Quelltext rein soll.
user profile iconChrischuh hat folgendes geschrieben Zum zitierten Posting springen:
kann ich stattdessen auch memo1.lines verwenden?
Sicher, davon die Eigenschaft Text um genau zu sein.
user profile iconChrischuh hat folgendes geschrieben Zum zitierten Posting springen:
es kommt immer die fehlermeldeung: maxlengh existiert nicht
was kann ich tun?
Wo steht die denn? "maxlengh" ist hier bisher nicht aufgetaucht.