Add(MainForm,2953706,14,133)
{
link(onCreate,4976115:doData,[])
}
Add(WebBrowser,5678376,231,119)
{
Width=712
Height=549
Align=5
URL=""
Silent=0
Point(PHandle)
Point(doFromText)
}
Add(DoData,4976115,91,147)
{
Data=String(https://www.google.com/advanced_image_search)
link(onEventData,5678376:doFromText,[])
link(Data,8968811:Text,[])
}
Add(StrList,8968811,91,77)
{
Strings=#45:<form><label for="imgc">Фильтр цвета:</label>|52:<input value="" id="imgc" name="imgc" type="hidden">|60:<input value="" id="imgcolor" name="imgcolor" type="hidden">|43:<div id="color-panel" style="display:none">|59:<div id="gmcr_imgc1" style="display:table-cell">любые</div>|61:<div id="gmcr_imgc2" style="display:table-cell">цветные</div>|65:<div id="gmcr_imgc3" style="display:table-cell">черно-белые</div>|71:<div id="gmcr_imgc4" style="display:table-cell">Прозрачные</div></form>|
}
Add(Button,14453633,161,189)
{
Left=10
Top=105
Width=50
Caption="Клик"
link(onClick,11984697:Zap,[])
}
Add(InlineCode,11984697,245,189)
{
@Hint=#13:Клик google 1|
WorkPoints=#3:Zap|
DataPoints=#1:h|
Code=#15:unit HiAsmUnit;|0:|9:interface|0:|61:uses kol,Share,Debug,windows,ActiveX,KOLSHDocVw,Win,ShellApi;|0:|4:type|28: THiAsmClass = class(TDebug)|10: private|16: wb:PControl;|9: public|16: h:THI_Event;|4: |42:procedure Zap(var Data:TData; index:word);|4: |5: end;|0:|15:implementation |0:|4:type|31: TKOLWebBrowser = PWebBrowser;|31: PKOLWebBrowser = PWebBrowser;|2: |26:procedure THiAsmClass.Zap;|5:begin|61: if not assigned (wb) then wb := PControl(ToIntegerEvent(h));|74: if PKOLWebBrowser(wb).OleObject.Document.all.tags('FORM').Length > 0 then|5:begin|81: PKOLWebBrowser(WB).OleObject.Document.getElementsByTagName('div').item(3).Click;|5: end;|4:end;|0:|4:end.|
link(h,5678376:PHandle,[])
}
Код страницы не весь и переключатели не видно. Как в схеме, в теории посчитать тэги div и нажать на тот, где есть id=gmcr_imgc3
Поправьте схему
Add(InlineCode,9377786,322,168)
{
WorkPoints=#5:doSet|
DataPoints=#1:h|
Code=#15:unit HiAsmUnit;|0:|9:interface|0:|32:uses kol,Share,Debug,KOLSHDocVw;|0:|4:type|28: THiAsmClass = class(TDebug)|10: private|16: wb:PControl;|9: public|16: h:THI_Event;|0:|46: procedure doSet(var dt:TData; index:word);|0:|5: end;|0:|14:implementation|0:|4:type|31: TKOLWebBrowser = PWebBrowser;|31: PKOLWebBrowser = PWebBrowser;|0:|28:procedure THiAsmClass.doSet;|16:var i,k:integer;|21: FormItem:Variant;|5:begin|61: if not assigned (wb) then wb := PControl(ToIntegerEvent(h));|79: if PKOLWebBrowser(wb).OleObject.Document.all.tags('div').Length = 0 then exit;|68: for i:=0 to PKOLWebBrowser(wb).OleObject.Document.forms.Length-1 do|7: begin|67: FormItem := PKOLWebBrowser(wb).OleObject.Document.forms.Item(i);|35: for k:=0 to FormItem.length-1 do|49: if FormItem.Item(k).Id = 'gmcr_imgc3'.Click;|6: end;|4:end;|0:|4:end.|
link(h,5678376:PHandle,[])
}
Add(MainForm,7984657,91,112)
{
link(onCreate,4976115:doData,[])
}
Add(WebBrowser,5678376,308,98)
{
Width=712
Height=549
Align=5
URL=""
Silent=0
Point(PHandle)
Point(doFromText)
}
Add(DoData,4976115,168,126)
{
Data=String(https://www.google.com/advanced_image_search)
link(onEventData,5678376:doFromText,[])
link(Data,8968811:Text,[])
}
Add(StrList,8968811,168,56)
{
Strings=#45:<form><label for="imgc">Фильтр цвета:</label>|52:<input value="" id="imgc" name="imgc" type="hidden">|60:<input value="" id="imgcolor" name="imgcolor" type="hidden">|43:<div id="color-panel" style="display:none">|59:<div id="gmcr_imgc1" style="display:table-cell">любые</div>|61:<div id="gmcr_imgc2" style="display:table-cell">цветные</div>|65:<div id="gmcr_imgc3" style="display:table-cell">черно-белые</div>|71:<div id="gmcr_imgc4" style="display:table-cell">Прозрачные</div></form>|
}
Add(Button,14453633,238,168)
{
Left=10
Top=105
Width=50
Caption="Клик"
link(onClick,9377786:doSet,[])
}