Einzelnen Beitrag anzeigen

nahpets
(Gast)

n/a Beiträge
 
#3

AW: Embedded WB Wordpress sticky Checken

  Alt 5. Jan 2016, 13:17
Hallo,

habe keine Ahnung, ob Dir dieses "Fundstück" von meiner Festplatte da unter Umständen, eventuell, vielleicht helfen könnte
Delphi-Quellcode:
// This will do a click on the first element of the first <FORM>, where an
// element is either <INPUT>, <SELECT> or <TEXTAREA>.
// If there is more than one button, you can do something like:
function WBClickButton(wb : TWebBrowser; sTagName : String; sValue : String; sType : String = 'SUBMIT') : Boolean;
var
  ovElements : OleVariant;
  i : Integer;
  k : integer;
begin
  Result := False;
  for k := 0 to wb.OleObject.Document.forms.Length - 1 do begin
    ovElements := wb.OleObject.Document.forms.item(k).elements;
    for i := 0 to (ovElements.Length - 1) do begin
      if (AnsiUpperCase(ovElements.item(i).tagName) = sTagName)
      and (AnsiUpperCase(ovElements.item(i).type) = sType)
      and (ovElements.item(i).Value = sValue) then begin
        ovElements.item(i).Click;
        Result := True;
        break;
      end;
    end;
    if not Result then begin
      for i := 0 to (ovElements.Length - 1) do begin
        if (AnsiUpperCase(ovElements.item(i).type) = AnsiUpperCase(sType))
        and (ovElements.item(i).Value = sValue) then begin
          ovElements.item(i).Click;
          Result := True;
          break;
        end;
      end;
    end;
  end;
end;
So als Ansatz zum Weiterforschen?
  Mit Zitat antworten Zitat