;#Region ;**** Directives created by AutoIt3Wrapper_GUI **** ;#AutoIt3Wrapper_Version=Beta ;;#AutoIt3Wrapper_UseX64=n ;#AutoIt3Wrapper_UseX64=Y ;Should be used for stuff like tagpoint having right struct etc. when running on a 64 bits os ;#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ;#AutoIt3Wrapper_Run_Debug_Mode=Y ;*************************************************************************************************************************** ;*****************SCRIPT TEMPLATE FOR CREATING NEW SCRIPTS USING WEBDRIVER, ETC.*******************************************8 ;***************************************************************************************************************************** GLOBAL $oExcel Global $ticker ;Global $oIEPGP ;UI Stuff: global $frmSimpleSpy, $edtCtrlInfo , $lblCapture, $lblEscape, $lblRecord, $edtCtrlRecord, $msg, $x, $y, $oUIElement, $oTW, $objParent, $oldElement, $text1, $t #include #include #include ;#include #include #include #Include #include #include #include #include #include ;From UI Examples, may not need all #include #include #include #include #include #include "UIAWrappers.au3" #include ;#include <_Dbug.au3> #include ;***** WebDriver Settup **************************************************************** #include "wd_core.au3" #include "wd_helper.au3" ;************************************************************************************* ;SET LOCATION FOR FILE PATH LOCATIONS: Global $Location $Location = 1 ;2 = Henderson, 1 = Prescott ;************************************************************************************* Local $GKPath[3] $GKPath[1] = "H:\main\A TRADING 2023\SCRIPTS DEV\geckodriver.exe" $GKPath[2] = "H:\Google Drive Folder\main\A TRADING 2023\SCRIPTS DEV\geckodriver.exe" Global $sDesiredCapabilities, $sSession, $sScriptName = "TradeScript" Global $zacksURL $_WD_DEBUG = 2 ; Set debug level: $_WD_DEBUG_None (0) = No logging to console, $_WD_DEBUG_Error (1) = Error logging to console, $_WD_DEBUG_Info (2) = Full logging to console (Default) ;This is 32B driver (copied from working demo, for example) Global $sDriver = $GKPath[$Location] ; <== Please modify this statement to your environment. Must be a local drive, network drives don't work! ; Setup Firefox _WD_Option("Driver", $sDriver) ;If @error Then Exit SetError(1, @error) _WD_Option('DriverParams', '--binary "C:\Program Files\Mozilla Firefox\firefox.exe" --log trace ') _WD_Option('Port', 4444) _WD_Option('DriverClose', False) $sDesiredCapabilities = '{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true,"setWindowRect":true}}' ;THIS IS A SCRATCH COMMENT AREA FOR COPYING INFO FOR EDITING SCRIPT ;/html/body/div[8]/div/div[1]/div[1] LR corner popup in Zacks ;/html/body/div[8]/div/div[1] Another Zacks popup ;***** WebDriver Settup Finish **************************************************************** _DebugSetup() ;*************************** DBUG OPTIONS******************* ;AutoItSetOption ( "option" [, param] ) ;AutoItSetOption ("TrayIconDebug", 1) ;Opt("TrayIconDebug", 0) ;0=no info, 1=debug line info ;*************************** DEBUG OPTIONS****************** AutoItSetOption("MustDeclareVars", 1) ;AutoItSetOption("WinTitleMatchMode", 2) Opt("WinTitleMatchMode", -2) ;Opt("RunErrorsFatal", 0) ;Added for solving the excel read issue random failure Opt("MouseCoordMode", 1) ;1=absolute, 0=relative, 2=client ;Opt("GUICoordMode", 2) Opt("GUIResizeMode", 1) Opt("GUIOnEventMode", 1) _UIA_Init() ;HotKeySet("{ESC}","ExitScript") _WD_Startup() ;If @error Then Exit SetError(2, @error) ;CREATE BROWSER SESSION $sSession = _WD_CreateSession($sDesiredCapabilities) ;If @error Then Exit SetError(3, @error) ;Consolewrite( " sSession = " & $sSession & @CRLF) _WD_Attach($sSession, "High-Growth","Title" ) ;It appears that the Attach worked based on the geckodriver console Local $oIdElements ;/html/body/main/article/div/div[1]/table/tbody[1]/tr[1]/td[1] ;THIS IS A VALID ELEMENT, IS FOUND WHEN URL IS OPENED WITH WEBDRIVER ;I Think this should work with Firefox ;***************************PROCESS THE CORE PORTFOLIO: ;$oIdElements = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/html/body/main/article/div/div[6]/table/tbody/tr/td[1]", Default, True) ;ID's, all sym/icon $oIdElements = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/html/body/main/article/div/div[1]/table/tbody[1]/tr/td[1]", Default, True) ;ID's, all sym/icon Local $oIdElementsUB = UBound($oIdElements) ;Same Upper bound for all column arrays Local $iIndex ;Get the text array for the TKR column $iIndex = 0 Local $TkrICON[100] ;Array for col 1 TkrICON text While ($iIndex < $oIdElementsUB) $TkrICON[$iIndex] = _WD_ElementAction($sSession, $oIdElements[$iIndex], "Text") $iIndex = $iIndex + 1 WEnd _ArrayDisplay($TkrICON, "$TkrICON") ;ARRAY OF TICKERS Exit