Hi, i feel im close to getting it to work, but there must be something im missing that's probably easy for you experts.
#include <IE.au3> #include <File.au3> #include <MsgBoxConstants.au3> $Visible = 1 Local $oIE $oIE = _IECreate("https://beemp3s.net/mp3-download.html", 0, $Visible, 1, 1) _IELoadWait($oIE) If $oIE <> @error Then ;_ArrayText() _QuerySite('Finding Hope - Without You') ;_IEQuit($oIE) ;Exit Else MsgBox(64 + 262144, 'Fail', 'Could not create a new window') EndIf ;============================================================================= Func _QuerySite($Name) Local $oIE_ObjectToSearch = _IEGetObjById($oIE, 'query') _IEDocInsertText($oIE_ObjectToSearch, $Name) Local $oIE_ObjectToClick = _IEGetObjById($oIE, "search-action") _IEAction($oIE_ObjectToClick, 'click') _IELoadWait($oIE, 2000) ;============================================================================= Local $oSubmitClick = _IEGetObjById($oIE, "col-md-12") _IEAction($oSubmitClick, "click") _IELoadWait($oIE, 2000) ;============================================================================= Local $oBtns = _IETagNameGetCollection($oIE, "div") For $oBtn In $oBtns If String($oBtn.classname) = "col-md-12" Then If String($oBtn.innertext) = "Download / Play" Then ConsoleWrite($oBtn.innertext & @CRLF) _IEAction($oBtn, 'click') EndIf EndIf Next ;============================================================================= ;Local $oElements = _IETagNameAllGetCollection($oIE) ;For $oElement In $oElements ; If $oElement.id Then MsgBox($MB_SYSTEMMODAL, "Element Info", "Tagname: " & $oElement.tagname & @CRLF & "id: " & $oElement.id & @CRLF & "innerText: " & $oElement.innerText) ;Next ;============================================================================= ;_IEQuit($oIE) ;Exit ;============================================================================= EndFunc ;==>_QuerySite ;============================================================================= Func _ArrayText() If FileExists('Titles.txt') Then Local $FO = FileOpen('Titles.txt') Local $R2A = FileReadToArray($FO) Local $iLineCount = @extended FileClose($FO) For $f = 0 To $iLineCount - 1 ConsoleWrite($f & ' - ' & $R2A[$f] & @CRLF) _QuerySite($R2A[$f]) Next Else MsgBox(64 + 262144, 'Fail', 'Could not find the file Titles.txt') EndIf EndFunc ;==>_ArrayText ;============================================================================= The idea is to get into this site, write into the search and click, which i did, but now the problem is clicking in any of the buttons in the results page, im looking for a way to click the first one, it always matches to what i want, so no need to fiddle around.
Thanks for help in advance.
is there a possibility to let ie.au3 click into a form? i use on a project where i need to click into a form where items are loaded just writing it in or fill the form is no option
ConsoleWrite("Hello Dolly on Line 1" & @CRLF) #include <IE.au3> ConsoleWrite("Hello Dolly on Line 5" & @CRLF) Local $oIE = _IECreate("www.autoitscript.com") ConsoleWrite("Hello Dolly on Line 10" & @CRLF) Can anyone put me on the right track to troubleshoot this one.. the IE browser is not opening.. it is not my primary browser since FF is but that has not been a problem in the past.. it all seems to work including compile but the generation of the IE browser.. Never had any problem before.. below is the results of the run.. any ideas on where I might look.. that is the only error i get and its only after a 30 second delay.. I suppose a time out..
; >"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "G:\show_pos.au3\test.au3"
; Hello Dolly on Line 1
; Hello Dolly on Line 5
; --> IE.au3 T3.0-2 Error from function _IECreate, (Browser Object Creation Failed)
; Hello Dolly on Line 10
; >Exit code: 0 Time: 30.46
I am still really new with AutoIT. We are using it to automate logging into web sites and I have encountered problems with focus. The target web page is configured to put the cursor into the first text field (username) when the page is loaded, and when I run the AutoIT script, which does the log in seems like it is just not starting where I expect it to be.
I have been kind of using ToolTip() to kind of help with debugging, but now I am wondering if the calls to ToolTip() are causing the focus to be messed up.
For example, at least visually, when the ToolTip() is called, I can see the cursor disappear from the web page text field and they when I do anything that is supposed to send keystrokes, they are going off somwhere else ("never-neverland").
But when I remove some of the ToolTip() calls, it works correctly.
So the questions I have are:
1) Do the ToolTip() calls interfere with/change where the focus on the target page are?
2) In general, what are the "rules" for where ToolTip can be used "safely" (== doesn't interfere with focus)?
What are the minimum system requirements(like Windows OS version, IE browser version, etc,.) for IE.au3(188.8.131.52) to work properly?