Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

ElementInnerText is emty

Post Reply
X11
Posts: 49
Joined: Thu Jul 25, 2019 10:15 am

ElementInnerText is emty

Post by X11 »

I use example DOMVisitor.

Code: Select all

procedure SimpleDOMIteration(const aDocument: ICefDomDocument);
var
  TempHead, TempChild : ICefDomNode;
begin
  try
    if (aDocument <> nil) then
      begin
        TempHead := aDocument.Head;

        if (TempHead <> nil) then
          begin
            TempChild := TempHead.FirstChild;

            while (TempChild <> nil) do
              begin
                CefLog('CEF4Delphi', 1, CEF_LOG_SEVERITY_INFO, 'TempChild.Name: ' + TempChild.Name + ', ElementInnerText: ' + Trim(TempChild.ElementInnerText));
                CefLog('CEF4Delphi', 1, CEF_LOG_SEVERITY_INFO, 'TempChild.GetFormControlElementType: ' + TempChild.GetFormControlElementType);

                TempChild := TempChild.NextSibling;
              end;
          end;
      end;
  except
    on e : exception do
      if CustomExceptionHandler('SimpleDOMIteration', e) then raise;
  end;
end;
in log all is emty
[0824/212638.521:INFO:CEF4Delphi(1)] TempChild.Name: LINK, ElementInnerText:
[0824/212638.521:INFO:CEF4Delphi(1)] TempChild.GetFormControlElementType:
[0824/212638.521:INFO:CEF4Delphi(1)] TempChild.Name: #text, ElementInnerText:
[0824/212638.521:INFO:CEF4Delphi(1)] TempChild.GetFormControlElementType:
[0824/212638.521:INFO:CEF4Delphi(1)] TempChild.Name: SCRIPT, ElementInnerText:
[0824/212638.521:INFO:CEF4Delphi(1)] TempChild.GetFormControlElementType:
[0824/212638.521:INFO:CEF4Delphi(1)] TempChild.Name: STYLE, ElementInnerText:
how to get what is underlined by a red line
http://prntscr.com/ox11lk
X11
Posts: 49
Joined: Thu Jul 25, 2019 10:15 am

Re: ElementInnerText is emty

Post by X11 »

I understood the problem
that's right

Code: Select all

TempHead := aDocument.Body;
instead

Code: Select all

TempHead := aDocument.Head;
Post Reply