我有一个html
页面,它有3个表单,3个提交按钮.按钮没有
名称,但它们有价值:
<input type="submit" VALUE="Login">
如何找到具有其值的按钮并单击它?
谢谢
procedure TForm1.Button1Click(Sender: TObject);
var
ovElements: OleVariant;
i: Integer;
begin
ovElements := WebBrowser1.OleObject.Document.forms.item(0).elements;
for i := 0 to (ovElements.Length - 1) do
if (ovElements.item(i).tagName = 'INPUT') and
(ovElements.item(i).type = 'SUBMIT') and
(ovElements.item(i).Value = 'Login') then
ovElements.item(i).Click;
end;
原文链接:https://www.f2er.com/html/232107.html