![]() |
|
|
|
|
#1
|
|||
|
|||
|
Код:
<input type="submit" value="Автоматически оставить коммент и заработать 1♥ " class="login_button" style="margin-left: 0px;" id="sendcommentbutton" onclick="commentProcessor();"><br/><br/> Подскажите как нажать такую кнопку в браузере? |
|
#2
|
||||
|
||||
|
у IHTMLElement метод click
|
|
#3
|
|||
|
|||
|
Цитата:
Код:
var i:integer;s:string;mylink:olevariant;
Doc: IHTMLDocument2;
Buttons: IHTMLElementCollection;
Button: IHTMLElement;
begin
try
Doc := webbrowser1.Document as IHTMLDocument2;
Buttons := Doc.all.tags('BUTTON') as IHTMLElementCollection;
for i := 0 to Buttons.length - 1 do
begin
Button := Buttons.item(i, EmptyParam) as IHTMLElement;
if AnsiSameText(Trim(Button.innerText), 'Автоматически оставить коммент и заработать 1♥') then
begin
Button.click;
Break;
end; end;
except end;
end; |
|
#4
|
||||
|
||||
|
Потому что это ни фига не <BUTTON> и текст на кнопке - ни фига не innerText.
|
|
#5
|
|||
|
|||
|
Цитата:
|
|
#6
|
||||
|
||||
|
Цитата:
|
|
#7
|
|||
|
|||
|
Цитата:
|
|
#8
|
||||
|
||||
|
Цитата:
|
|
#9
|
||||
|
||||
|
1. Ну а ты не видишь что ли, что тег не BUTTON, а INPUT?
2. Гугли IHTMLElement.GetAttribute. Тебе надо сверять атрибуты type и value. |