Autor Beitrag
JoachimQ
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 59


D2, D6 und D7
BeitragVerfasst: Mo 21.08.06 05:18 
Hallo!

Ich hab mit einer TWebBrowserkomponente eine Website geöffnet.
Bis jetzt schaffe ich es den Quelltext zu speichern.
Ich möchte aber den Text speichern, der auf der Website sichtbar ist.
Wie geht das?
Ironwulf
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 733
Erhaltene Danke: 2



BeitragVerfasst: Mo 21.08.06 06:47 
die tags rauslöschen, das wirst du wohl selber machen müssen
das könnte dann etwa so ausschaun
ausblenden Delphi-Quelltext
1:
2:
3:
4:
var s: String;
Repeat
delete(s,Pos('<',s),Pos('>',s)-Pos('<',s)+1);
Until Pos('<',s) = 0;

s is der quelltext den du am besten vorher als filesstream lädst, das ganze funktioniert aber auch nur solang bis kein < oder > im text vorkommt
JoachimQ Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 59


D2, D6 und D7
BeitragVerfasst: Mo 21.08.06 07:16 
Hallo!!!

Man kann doch beim IE im Menü auf Datei - Speichern und dann als Dateityp txt wählen und dann damit nur den Text abspeichern. Wie funktioniert das gleiche mit der TWebbrowserkomponente?
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Mo 21.08.06 07:26 
Hallo,

damit:
ausblenden Delphi-Quelltext
1:
s := WebBrowser1.OleObject.Document.documentElement.innerText;					

Bei Frames sollte Dir das weiterhelfen:
Daten aus webBrowser auslesen.

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
JoachimQ Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 59


D2, D6 und D7
BeitragVerfasst: Mo 21.08.06 07:49 
wie kann ich das dann als Textdatei speichern?
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Mo 21.08.06 08:12 
zb. So.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
procedure TForm1.Button1Click(Sender: TObject);
var
sl:TStringList;
begin
 s := WebBrowser1.OleObject.Document.documentElement.innerText;
 try
  sl := TStringList.Create;
  sl.Text:=s;
  sl.SaveToFile('C:\test.txt');
  finally
  sl.Free;
 end;
end;