Тема: AHK_IE
Добрый день! Подскажите, пож-та, как выбрать "Заявка" в поле "Категория". До обновление сайта код работал:
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance force
webpage := "https://inseption.with5.glpi-network.cloud/front/ticket.form.php"
;~ IE(URL)
;~ {
;~ For ie in ComObjCreate( "Shell.Application" ).Windows
;~ If InStr(ie.FullName, "iexplore.exe" ) && InStr(ie.LocationURL, URL)
;~ Return ie
;~ }
;~ ie := IE(URL)
;~ ie.navigate(webpage)
;~ while ie.readystate <> 4
;~ sleep 300
ie := ComObjCreate("InternetExplorer.Application")
ie.Navigate(webpage)
ie.Visible := true
while ie.readystate <> 4
sleep 300
if ( ie.document.querySelectorAll("input").length < 8 )
{
ie.document.querySelectorAll("input")[1].value := "user"
ie.document.querySelectorAll("input")[2].value := "12345"
ie.document.querySelectorAll("input")[5].click()
}
while ie.document.getElementsByClassName("layout_lefttab").length = 0
{
sleep 300
continue
}
while ie.document.getElementsByClassName("loadingindicator").length != 0
{
sleep 300
continue
}
ie.document.getElementsByName("itilcategories_id")[0].value := 6
Change := ie.document.createEvent("Event")
Change.initEvent("change", true, true)
ie.document.getElementsByName("itilcategories_id")[0].dispatchEvent(Change)
return
Esc::
{
ie.quit
Process, Close, iexplore.exe
ExitApp
}