A jak ma działać gdzie w tym kodzie HTML anie PHP widzisz atrybut id="sendButton" ?
Trochę miało tego kodu HTML gdyby było więcej można by znaleźć lepszy sposób niż szukanie wszystkich input (np. można by przeszukać tylko określony form)
var
Document: IHTMLDocument3;
Elements: IHTMLElementCollection;
Element: IHTMLInputElement;
i: Integer;
begin
Document:= WebBrowser1.Document as IHTMLDocument3;
if Assigned(Document) then
begin
Elements:= Document.getElementsByTagName('input');
if Assigned(Elements) then
begin
for i:=0 to Elements.length - 1 do
begin
Element:= Elements.item(i, EmptyParam) as IHTMLInputElement;
if (AnsiCompareStr(Element.type_, 'image') = 0) and
(AnsiCompareStr(Element.alt, 'Wyślij wiadomość') = 0) then
begin
//IHTMLElement(Element).click; ten kod powodował Access Violation w nowych Delphi
OleVariant(Element).click; //ten działa w starych i nowych
break;
end;
end;
end;
end;
end;