AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Netzwerke Delphi Mozilla Activex Control und IHTMLElementCollection
Thema durchsuchen
Ansicht
Themen-Optionen

Mozilla Activex Control und IHTMLElementCollection

Ein Thema von capo · begonnen am 9. Jan 2007 · letzter Beitrag vom 14. Jan 2007
Antwort Antwort
capo

Registriert seit: 7. Jul 2006
453 Beiträge
 
Delphi 11 Alexandria
 
#1

Mozilla Activex Control und IHTMLElementCollection

  Alt 9. Jan 2007, 23:59
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:
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;
in dieser zeile
ecoll := ((WebBrowser1.Document as IHTMLDocument2).all.tags('Table') bekomme ich folgende fehlermeldung:
Zitat:
---------------------------
Benachrichtigung über Debugger-Exception
---------------------------
Im Projekt Project2.exe ist eine Exception der Klasse EOleException aufgetreten. Meldung: 'Nicht implementiert'. Prozess wurde angehalten. Mit Einzelne Anweisung oder Start fortsetzen.
---------------------------
OK Hilfe
---------------------------
was mache ich falsch?

gruss vom capo
Hotte
  Mit Zitat antworten Zitat
Benutzerbild von dizzy
dizzy

Registriert seit: 26. Nov 2003
Ort: Lünen
1.932 Beiträge
 
Delphi 7 Enterprise
 
#2

Re: Mozilla Activex Control und IHTMLElementCollection

  Alt 10. Jan 2007, 00:25
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.
Fabian K.
INSERT INTO HandVonFreundin SELECT * FROM Himmel
  Mit Zitat antworten Zitat
capo

Registriert seit: 7. Jul 2006
453 Beiträge
 
Delphi 11 Alexandria
 
#3

Re: Mozilla Activex Control und IHTMLElementCollection

  Alt 10. Jan 2007, 00:36
hallo dizzy
dachte ich zuerst auch nur wenn du dir mal folgendes beispiel ansiehst wirst du sehen, dass dort IHTMLElementCollection verwendet wird:
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]
hat das was mit mit meinem problem zu tun?
Hotte
  Mit Zitat antworten Zitat
capo

Registriert seit: 7. Jul 2006
453 Beiträge
 
Delphi 11 Alexandria
 
#4

Re: Mozilla Activex Control und IHTMLElementCollection

  Alt 14. Jan 2007, 16:59
Hallo...wollte nur nochmal auf meine Frage aufmerksam machen.
gruss vom capo
Hotte
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:17 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz