Hi everyone, hope you are doing fine
Well, I'm currently writing a small script that goes to a certain web page, finds the first link of a specified section and download the file associated to this link.
Depending on the computer that the tool is launched, the script gets the computer model and search in the (provided here) ini file which link to follow.
At first, Dell was kind enough to provide only one link but now, they provide two of them. The first one is now a .txt file ( ) whereas my script has been designed to download only the fist and latest link released for the BIOS Update.
Here's the current code which is working with only the first and latest link of the BIOS category:
So the question is:
In the case of double links like shown in the picture above, how it is possible to tell the script to download only the link containing an the .exe file?
Of course, I could have changed the array result to  instead of  [which is working] but it seems that Dell does that randomly and that I deal with a lot of computer models.
Thanks for the help you can provide,
I'm trying to click a button on a web page. I have added a couple of MsgBox lines to allow me to watch what happens on the page. As you can see the first half of my script enters data into text boxes on the page. I have no problem there. I just cannot click on the region buttons. The "set focus" line causes an outline to appear around the EU button and the "click button" line causes the "Pick a Region" text to disappear. Here is the code I have so far.
#include <IE.au3> Local $oIE = _IECreate("http://questchecker.com/") Local $iQuestID = "123456" Local $sCharacterName = "CharacterName" Local $colForms = _IEFormGetCollection($oIE) $iCount = 0 For $oForm In $colForms $oFormElements = _IEFormElementGetCollection($oForm) For $oFormElement In $oFormElements $iCount = $iCount + 1 Local $sTagName = StringLower($oFormElement.tagName) Local $sElementType = $oFormElement.type Local $sElementName = $oFormElement.name Switch $iCount Case 6 _IEFormElementSetValue($oFormElement, "MyRealm", 0) ; realm Case 7 _IEFormElementSetValue($oFormElement, $sCharacterName, 0) Case 8 _IEFormElementSetValue($oFormElement, $iQuestID, 0) EndSwitch Next Next Local $oButtons = _IEGetObjByName($oIE, "questForm") For $oButton In $oButtons If _IEFormElementGetValue($oButton) = "US" Then MsgBox(0, "", "Click Okay to set focus") _IEAction($oButton, "focus") MsgBox(0, "", "Click Okay to click button") _IEAction($oButton, "click") ExitLoop EndIf Next MsgBox(0, "", "Click Okay to quit") _IEQuit($oIE) Exit
It's my understanding there is IE.au3 script for automation of IE through a COM interface. But I believe this only works with IE and won't work with Edge, correct? Is there a COM interface that works with Edge, or any other options for integrating with Edge (other than IUIAuatomation?)
I know there was also a FF.au3 UDF, but Mozilla abandoned the support for their mozrepl in favor of Web Extensions, and my understanding is that the FF.au3 UDF no longer works, is that correct?
There was also a Chrome.au3 UDF, but my read on the forums indicate that this also broke many Chrome releases past.
At this point, it seems like my best option is to use IE.au3, but that forces users on IE, which is probably a showstopper.
Is there another way to bridge into the DOM? I have written Web Extensions for Chrome and Firefox before. They can communicate with external processes via AJAX or messaging. I'm wondering if I can build what I need in a WebExtension and then trigger it from AutoIT Script, and gather up the results somewhere.
I know there was the ISimpleDOM.au3 and some Microsoft Accessability scripts, but they seem to only be partially supported in browsers, and I didn't have a lot of luck getting those examples to run correctly.
I'd like to ask some help with IE interaction.
Basically, My script opens a webpage, then checks for an expected form named login and passwd:
; Collects info from the opened page $oForms = _IEFormGetCollection($oIE) Local $iNumForms = @extended If $iNumForms = 1 Then $oForm = _IEFormGetCollection($oIE, 0) $oObjs = _IEFormElementGetCollection($oForm) Local $iNumObj = @extended Else ; insert error treatment here Exit EndIf If $iNumObj = 3 Then ; Check if there are 3 objects in the page (login / pass / submit) Sleep(1000) ; Emulating a user typing infos $oObj = _IEFormElementGetObjByName($oForm, "login") _IEFormElementSetValue($oObj, "barackobama") Sleep(1000) ; Emulating the user $oObj = _IEFormElementGetObjByName($oForm, "passwd") _IEFormElementSetValue($oObj, "UncleSam2015") Sleep(1000) ; Emulating the user _IEFormSubmit($oForm) Else ; insert error treatment here Exit EndIf It goes to a loading screen, it usually takes 2-10 seconds. Then, it goes to a main screen dashboard.
The ElementGetObjByName gets this info from the page:
<input class="CTXMSAM_ContentFont" type="Password" title="Enter password" name="passwd" size="30" maxlength="127" style="width:100%;"> I need to verify if it really logs in (kinda worked around this), and how long it takes to load the main screen (that classic loading spinning ball).
I was trying to do it by counting the forms or objects, but it's not possible, since there is no forms on the main screen, and both the loading screen and the main screen has 1 object. The main screen though, has an object already identifier (searchbox), but it also doesn't have a name. The code of the searchbox is as below:
<input class="searchbox-textbox lighttext" type="text" autocomplete="off" title="Search"> Is there any way for me to track/identify this page with or without IE.au3?
I sort of get a break from "things I have to do" and can do a bit of "things I want to do" for scripting for a bit
One thing that would be infinitely useful that I really need to get under my belt is internet/website automation.
I used to use this heavily years ago when working helpdesk before I converted over to AutoIT (was using the "other guys" stuff back then)
IE being the easiest to work with I would assume (even though its not a browser I use)
I google/search and poke in and out of various threads to learn some of it, but I had to ask do we have like a be all end all thread or resource that really shows how to figure this stuff out? An example would be opening a page and then finding all the links/buttons/forms to interact with. I am currently doing that with a For loop using one of the GetCollection type of functions, but it could be easier to look at the page source or maybe even have a tool like the Autoit Window Info tool that can simply mouse over things but I have not found the information to point to these techniques/tools.
Any tips/tricks, links, etc I can get would be a good help to start me in the right direction.