![]() |
|
|
|||||||
| Регистрация | << Правила форума >> | FAQ | Пользователи | Календарь | Поиск | Сообщения за сегодня | Все разделы прочитаны |
![]() |
|
|
Опции темы | Поиск в этой теме | Опции просмотра |
|
#1
|
|||
|
|||
|
Здравствуйте.
Подскажите плз как программно через Webbrowser поставить галочку на сайте. Код:
while WebBrowser1.ReadyState<READYSTATE_COMPLETE do
Application.ProcessMessages;
document:=WebBrowser1.Document as IHTMLDocument2;
all:=document.all;
for i:=0 to all.length-1 do
begin
(all.item('username', 0) as IHTMLElement).innerText:=edit1.Text;
(all.item('password', 0) as IHTMLElement).innerText:=edit2.Text; |
|
#2
|
||||
|
||||
|
Код:
var
Document: OleVariant;
ElementCollection: IHTMLElementCollection;
i: Integer;
begin
...
while WebBrowser1.ReadyState<READYSTATE_COMPLETE do
Application.ProcessMessages;
ElementCollection:=IUnknown(Document.all) as IHTMLElementCollection;
for i:=0 to ElementCollection.length-1 do
begin
if (ElementCollection.item(i, EmptyParam) as IHTMLElement).tagName='INPUT' then
begin
if (ElementCollection.item(i, 0) as IHTMLInputElement).type_='radio' then
if (ElementCollection.item(i, 0) as IHTMLInputElement).value='opera' then
(ElementCollection.item(i, 0) as IHTMLInputElement).checked:=True;
end;
end;Последний раз редактировалось NumLock, 19.01.2012 в 18:44. |
| Этот пользователь сказал Спасибо NumLock за это полезное сообщение: | ||
scroyler (19.01.2012)
| ||
|
#3
|
|||
|
|||
|
Код:
var
i: Integer;
elem: IHTMLElement;
document: IHTMLDocument2;
all: IHTMLElementCollection;
begin
while WebBrowser1.ReadyState<READYSTATE_COMPLETE do
Application.ProcessMessages;
document:=WebBrowser1.Document as IHTMLDocument2;
all:=document.all;
for i:=0 to all.length-1 do
begin
(all.item('month', 0) as IHTMLOptionElement).value:='01';
или
(all.item('month', 0) as IHTMLOptionElement).value:='Август';
end;
end;Можешь показать код полностью? |
|
#4
|
|||
|
|||
|
Что то не получается
Код:
<input type="checkbox" value="1" id="cb_rules_agree" name="agree"/> пробую так. Код:
if (ElementCollection.item(i, 0) as IHTMLInputElement).type_='checkbox' then
if (ElementCollection.item(i, 0) as IHTMLInputElement).value='1' then
(ElementCollection.item(i, 0) as IHTMLInputElement).checked:=True;а как сделать с выпадающим списком? |
|
#5
|
||||
|
||||
|
жми на TCheckBox:
http://zalil.ru/32535060 |
| Этот пользователь сказал Спасибо NumLock за это полезное сообщение: | ||
scroyler (19.01.2012)
| ||
|
#6
|
|||
|
|||
|
Большое спасибо!!! То что надо!
а не подскажешь как с выпадающим списком? |