Floppy Posted June 2, 2019 Posted June 2, 2019 <div class="lmt__language_select__menu" dl-test="translator-source-lang-list" style="left: 87px;"> <button dl-value="auto" tabindex="100">Qualsiasi lingua (rileva)</button> <button dl-value="IT" tabindex="100">Italiano</button> <button dl-value="EN" tabindex="100">Inglese</button> <button dl-value="DE" tabindex="100">Tedesco</button> <button dl-value="FR" tabindex="100">Francese</button> <button dl-value="ES" tabindex="100">Spagnolo</button> <button dl-value="PT" tabindex="100">Portoghese</button> <button dl-value="NL" tabindex="100">Olandese</button> <button dl-value="PL" tabindex="100">Polacco</button> <button dl-value="RU" tabindex="100">Russo</button> </div> Hello! I would like to use IE to click a button in the div. I need to get the object of the div by 'dl-test' attribute and then the object of the button by 'dl-value'. Is there a function to do this? I tried the following, but it isn't working #include <IE.au3> $oIE = _IECreate() _IENavigate($oIE, 'https://www.deepl.com/it/translator#es/it', 1) Local $oInputs = _IETagNameGetCollection($oIE, "button") Local $sTxt = "" For $oInput In $oInputs $sTxt &= $oInput.type & - $oInput.GetAttribute("dl-value") &@CRLF Next MsgBox(0, "", "Form: " & $oInput.form.name & @CRLF & @CRLF & " Types :" & @CRLF & $sTxt)
FrancescoDiMuro Posted June 2, 2019 Posted June 2, 2019 @Floppy Are you able to see the Input type or the script returns some error? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
Jfish Posted June 3, 2019 Posted June 3, 2019 I see a message box with all the types when I run it ... Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt
Floppy Posted June 4, 2019 Author Posted June 4, 2019 19 hours ago, Jfish said: I see a message box with all the types when I run it ... If I want to click on the button "Spagnolo" for example, I need to get the button which has 'dl-value=ES', so I need a way to get the 'dl-value' value.
Nine Posted June 4, 2019 Posted June 4, 2019 This works well : #include <IE.au3> Opt ("MustDeclareVars", 1) Global $oIE = _IECreate ("https://www.deepl.com/it/translator#es/it") Local $Text Local $oInputs = _IETagNameGetCollection($oIE, "button") For $oInput In $oInputs If $oInput.GetAttribute("dl-value") = "ES" Then $Text = $oInput.innerText $oInput.click () ExitLoop EndIf Next MsgBox ($MB_SYSTEMMODAL,"",$Text) “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now