Autor Beitrag
Spooky
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 37

Fedora Core 1, Win XP Prof Corp.
D6 Enterprise, D7 Enterprise
BeitragVerfasst: So 30.11.03 15:13 
moin
wie kann ich von der aufgerufenen seite ueber den twebbrowser den html code auslesen lassen ?
oder giebt es eine andere moeglichkeit womit ich den html code auslesen kann ?

wenn ja hat jemand dazu nen kleine anleitung fuer mich oder so ?

_________________
gruss
Spooky
toms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: So 30.11.03 16:14 
Hi,

Da schaust du hier:

www.delphi-forum.de/...highlight=webbrowser

Abschnitt 12)
Spooky Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 37

Fedora Core 1, Win XP Prof Corp.
D6 Enterprise, D7 Enterprise
BeitragVerfasst: So 30.11.03 18:10 
mhh irgendwie finde ich dazu nix :(
oder ich bin blind
und dieser andere "angeblich verbesserte twebbrowser" geht bei mir nicht weil einige sachen im code wohl nicht unter d7 klappen

_________________
gruss
Spooky
ixtreme
Gast
Erhaltene Danke: 1



BeitragVerfasst: So 30.11.03 18:25 
such doch mal im swissdelphicenter, ich meine da hätt ich son Code mal gefunden!

Gruß

ixtreme.de
patrick
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1481

WIN2k, WIN XP
D6 Personal, D2005 PE
BeitragVerfasst: So 30.11.03 18:56 
damti du nicht so lange suchen musst:
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
uses 
  ActiveX; 

function WB_SaveHTMLCode(WebBrowser: TWebBrowser; const FileName: TFileName): Boolean; 
var 
  ps: IPersistStreamInit; 
  fs: TFileStream; 
  sa: IStream; 
begin 
  ps := WebBrowser.Document as IPersistStreamInit; 
  fs := TFileStream.Create(FileName, fmCreate); 
  try 
    sa := TStreamAdapter.Create(fs, soReference) as IStream; 
    Result := Succeeded(ps.Save(sa, True)); 
  finally 
    fs.Free; 
  end; 
end; 

function WB_GetHTMLCode(WebBrowser: TWebBrowser; ACode: TStrings): Boolean; 
var 
  ps: IPersistStreamInit; 
  ss: TStringStream; 
  sa: IStream; 
  s: string; 
begin 
  ps := WebBrowser.Document as IPersistStreamInit; 
  s := ''; 
  ss := TStringStream.Create(s); 
  try 
    sa := TStreamAdapter.Create(ss, soReference) as IStream; 
    Result := Succeeded(ps.Save(sa, True)); 
    if Result then ACode.Add(ss.Datastring); 
  finally 
    ss.Free; 
  end; 
end; 

procedure TForm1.Button1Click(Sender: TObject); 
begin 
  WB_SaveHTMLCode(Webbrowser1, 'c:\test.txt'); 
end; 

procedure TForm1.Button2Click(Sender: TObject); 
begin 
  WB_GetHTMLCode(Webbrowser1, Memo1.Lines); 
end;

link:
www.swissdelphicente...showcode.php?id=1112

_________________
Patrick
im zweifelsfall immer das richtige tun!!!
Spooky Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 37

Fedora Core 1, Win XP Prof Corp.
D6 Enterprise, D7 Enterprise
BeitragVerfasst: So 30.11.03 19:25 
danke habs gefunden ist im grunde nur ein befehl
IdHTTP1.Get('url');

:)

_________________
gruss
Spooky
obbschtkuche
Gast
Erhaltene Danke: 1



BeitragVerfasst: So 30.11.03 21:15 
Das ist aber nicht mit TWebBrowser sondern mit TidHTTP...
Spooky Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 37

Fedora Core 1, Win XP Prof Corp.
D6 Enterprise, D7 Enterprise
BeitragVerfasst: So 30.11.03 21:18 
ups stimmt *gg*
*schaem
aber klappt super :)

_________________
gruss
Spooky
sauerkraut
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 70



BeitragVerfasst: Di 02.12.03 19:17 
IdHTTP1.Get('url'); geht bei mir nicht...er meint 'get' sei ein undefinierter bezeichner!
Spooky Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 37

Fedora Core 1, Win XP Prof Corp.
D6 Enterprise, D7 Enterprise
BeitragVerfasst: Di 02.12.03 19:23 
versuch mal oben bei uses IdGlob oder IdGlobal
einzufuegen
aber bei mir gehts auch ohne *wunder

_________________
gruss
Spooky
ixtreme
Gast
Erhaltene Danke: 1



BeitragVerfasst: Di 02.12.03 19:27 
sauerkraut: hast du denn die indy komponenten....?
sauerkraut
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 70



BeitragVerfasst: Di 02.12.03 19:32 
LOL einmal gings nich und dann plötzlich doch...sry