![]() |
Mozilla Activex Control und IHTMLElementCollection
hallo und schönes neues jahr noch von mir.
ich experimentiere gerade mit dem mozilla activex control rum und würde gerne eine tabelle aus einer webseite auslesen. dazu verwende ich diesen code:
Delphi-Quellcode:
in dieser zeile
var ecoll: IHTMLElementCollection;
tabs: IHTMLTable2; i, j: Integer; lst: TStringList; g: string; begin lst := TStringList.Create; ecoll := ((WebBrowser1.Document as IHTMLDocument2).all.tags('Table') as IHTMLElementCollection); for i := 0 to ecoll.length - 1 do begin tabs := ecoll.item(i, 0) as IHTMLTable2; lst.Add('Tabelle: ' + IntToStr(i + 1)); for j := 2 to tabs.cells.length - 3 do lst.Add((tabs.cells.item(j, 0) as IHTMLElement).innerText); memo1.lines.add(lst[i]); end;
Delphi-Quellcode:
bekomme ich folgende fehlermeldung:
ecoll := ((WebBrowser1.Document as IHTMLDocument2).all.tags('Table')
Zitat:
gruss vom capo |
Re: Mozilla Activex Control und IHTMLElementCollection
Wenn ich das richtig verstanden habe auf der Mozilla ActiveX Seite, dann ist die Komponente noch in der Entwicklung, und daher noch nicht vollständig implementiert verfügbar. Ich würde fast vermuten, dass du da in ein "Schlagloch" getreten bist.
|
Re: Mozilla Activex Control und IHTMLElementCollection
hallo dizzy
dachte ich zuerst auch nur wenn du dir mal ![]()
Delphi-Quellcode:
procedure TfrmMain.mViewSourceClick(Sender: TObject);
{show page source} {document.Body.ParentElement.OuterHtml causes AV} {look for <html> tag and get the InnerHtml from it - Nick Bradbury} {source that is actually shown in browser including any created by javascript} var sPage : string; hDoc: IHTMLDocument2; hElm : IHTMLElement; hCol : IHTMLElementCollection; i, nLen : integer; frmSource: TfrmSource; begin {get page source} if not(mzGecko.Busy) then begin try hDoc := mzGecko.Document as IHTMLDocument2; {first get body, in case looking for <html> fails} sPage := hDoc.Body.OuterHtml; {get collection of all elements, then look for <html>} hCol := hDoc.All; if (Assigned(hCol)) then begin nLen := hCol.length; for i := 0 to nLen - 1 do begin hElm := IHTMLElement(hCol.Item(i, varEmpty)); if SameText(hElm.TagName, 'html') then sPage := hElm.InnerHtml; {found <html>} end; {for i..} end; {if Assigned(hCol)..} {show in frmSource (frees itself when closed)} frmSource := TfrmSource.Create(self); frmSource.Caption := frmSource.Caption + cmbxAddress.Text; frmSource.mmSource.Lines.Add(sPage); frmSource.Show; except {handle exceptions} on E : Exception do begin MessageDlg('ERROR: Unable to View Source.' + #13 + E.ClassName + ': ' + E.Message + '.', mtError, [mbOk], 0); end; {on Exception..} end; {try..except..} end; {if not(mzGecko.Busy)..} end; {procedure TfrmMain.mViewSourceClick} [EDIT] ![]() |
Re: Mozilla Activex Control und IHTMLElementCollection
Hallo...wollte nur nochmal auf meine Frage aufmerksam machen.
gruss vom capo |
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:04 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz