4 posts in this topic
I've written the script below to automatically login to a website, in this case infusionsoft.com
The auto login works fine. Is there a way for me to get errors from Internet explorer, if the login fails because of wrong login credentials. I have searched around, but cannot make sense of this.
Please forgive me if I have overlooked something simple. I am new to autoit. Please see my script below.
;This line sets the website page to open and inject information
Global $oIE = _IECreate("https://signin.infusionsoft.com/login")
;set the variables to pull the username and password object names
Local $username = _IEGetObjByName ($oIE, "username")
Local $password = _IEGetObjByName ($oIE, "password")
;set the $oButtons variable to pull all the values of the button class
Local $oButtons = _IETagnameGetCollection($oIE, "button")
;set the username and password values on the login form
_IEFormElementSetValue ($username, "")
_IEFormElementSetValue ($password, "")
; loop through the button class until we find the text on the login button, then click the button
For $oButton in $oButtons
If String($oButton.value) = " Log In " Then $test = $oButtons
if (@error) then MsgBox (0, "Error", @error)
Anyone have any idea how to close all open tabs except a specific one I manually open. Assuming I don't know what is open in all the tabs except just the one I want to keep open.
I didn't want to use sendkeys and I was trying to use the following code to list the title (or url) of the 3 open tabs and after I got that part working I would just close the other 2. This sample only displays the title of the first open tab
#include <IE.au3> Const $ie_new_in_tab = 0x0800 $oIE = _IECreate("https://www.autoitscript.com") __IENavigate($oIE, "https://www.autoitscript.com/forum/", 1, $ie_new_in_tab) ;(obj,url,wait,param) __IENavigate($oIE, "https://www.google.com/", 1, $ie_new_in_tab) ;(obj,url,wait,param) Local $aIE $aIE = 0 Local $i = 1, $oIE While 1 $oIE = _IEAttach("", "instance", $i) If @error = $_IEStatus_NoMatch Then ExitLoop ConsoleWrite(_IEPropertyGet($oIE, "title") & @CRLF) ReDim $aIE[$i + 1] $aIE[$i] = $oIE ;each item holds object $aIE = $i ;first item holds count $i += 1 WEnd MsgBox($MB_SYSTEMMODAL, "Browsers Found", "Number of browser instances in the array: " & $aIE) ; This doesn't return the list of tabs in the console just the first tab
Thanks for any and all help
I'm trying to click on Java Dropbox using IE. However, I'm running into problems. There is a Dropbox "Please Select" with two options "Buy" and "Sell".
I'm able to click on a drop box (please see code below) but i'm unable to select "Buy" or "Sell"".
Local $sMyString = "Please Select" ;############ ENTER ############# Local $oLinks = _IELinkGetCollection($oIE) For $oLink In $oLinks Local $sLinkText = _IEPropertyGet($oLink, "innerText") If StringInStr($sLinkText, $sMyString) Then _IEAction($oLink, "click") ExitLoop EndIf Next
I'm working on a task where, a PDF file is opened (in IE browser) when I click a link in a website.
I have to read the first page of the PDF to find particular strings. Can you please share some ideas?
i would like to set a value into an INPUT field.
Checked the _IEFormElementSetValue function but that does require _IEFormGetObjByName and this is where the problem comes in. The input field I want to write to is not a part of a form tag. It is part of a table.
<input type="text" class="w2" id="nabidka_vozidel_formular_tach_od" name="nabidka_vozidel_formular_tach_od" onchange="GLOBAL.pocetInzerceNZ("nabidka_vozidel_formular","tach_od","");" autocomplete="off"> I tried this but that didn't work:
$oDownloadSamples = _IEGetObjById($oIE, "nabidka_vozidel_formular_tach_od") _IEFormElementSetValue($oDownloadSamples, "123") If you want to try the site I'm working with is https://www.tipcars.cz/. There is a menu on the top left hand side and if you click the "vyhledat" button the input fields will show up.