Here is a working sample using https://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/
You can ignore most of the Global variables. I use this as a template for another script I wrote.
```
#include <GUIConstantsEx.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>
#include <EditConstants.au3>
#include <WinAPIGdi.au3>
#include <WinAPIGdiDC.au3>
#include <WinAPIHObj.au3>
#include <WinAPISysWin.au3>
#include <AD.au3>
#include <Array.au3>
#include "UIAWrappers.au3"
#include <FileConstants.au3>
#include <WinAPIFiles.au3>
#include <GuiListBox.au3>
#include <Word.au3>
#include <File.au3>
#include <Excel.au3>
Opt("WinWaitDelay", 150)
Opt("WinTitleMatchMode", 2)
Opt("WinDetectHiddenText", 1)
Opt("MouseCoordMode", 2)
Opt("SendKeyDelay", 10)
Opt("GUIResizeMode", 1)
HotKeySet("^!x", "MyExit")
Global $ver = "1.0.2.7"
Global $__goError = ObjEvent("AutoIt.Error", "__Excel_COMErrFunc") ; At the top of your script
Global $oCOMErrorHandler = ObjEvent("AutoIt.Error", "_User_ErrFunc")
Global $Guih, $MAINTab, $MAIN, $button1, $button2, $button3, $button4, $idListBox1, $inputEmployeeUsername, $inputSAName, $ADusername, $iLastTab, $editOU
Global $inputSAPassword, $editEmail, $editEmployeeID, $editLastName, $editCity, $editRegion, $editTitle, $editManager, $ADpassword, $editState, $DF
Global $C9, $hWnd, $g_szVersion, $msg, $employeeName, $aResult, $aManager, $aProperties1, $aProperties2, $aString, $aString1, $aString2, $iCurrTab, $editFirstName
Global $ManagerUN, $OU, $Line_Split, $iIndex, $GulfCoast, $SouthEast, $MountainWest, $MidAtlantic, $SouthTexas, $NorthTexas, $MidWest, $MidEast, $editZip
Global $file1, $OU_Name_Return_R, $OU_Name_Trim_L, $OU_Name_Split, $OU_Name_Trim_R, $Search, $State, $TD, $hWnd2, $oWord1, $button11, $editStreet, $CSVName, $Web
$Web = "https://www.macrotrends.net/1476/copper-prices-historical-chart-data"
ShellExecute("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", "--new-window --force-renderer-accessibility " & $Web, "", "")
WinWait("Copper Prices - 45 Year Historical Chart | MacroTrends - Google Chrome", "", 4)
$hWnd = WinGetHandle("Copper Prices - 45 Year Historical Chart | MacroTrends - Google Chrome")
WinActivate($hWnd)
WinSetState($hWnd, "", @SW_MAXIMIZE)
Local $oP8=_UIA_getObjectByFindAll($UIA_oDesktop, "Title:=Copper Prices - 45 Year Historical Chart | MacroTrends - Google Chrome;controltype:=UIA_PaneControlTypeId;class:=Chrome_WidgetWin_1", $treescope_children)
_UIA_Action($oP8,"setfocus")
Local $oP7=_UIA_getObjectByFindAll($oP8, "Title:=Copper Prices - 45 Year Historical Chart | MacroTrends;controltype:=UIA_DocumentControlTypeId;class:=Chrome_RenderWidgetHostHWND", $treescope_children)
_UIA_Action($oP7,"setfocus")
;~ First find the object in the parent before you can do something
Local $oUIElement=_UIA_getObjectByFindAll(" DownloadHistoricalData.mainwindow", "title:= Download Historical Data;ControlType:=UIA_ButtonControlTypeId", $treescope_subtree)
Local $oUIElement=_UIA_getObjectByFindAll($oP7, "title:= Download Historical Data;ControlType:=UIA_ButtonControlTypeId", $treescope_subtree)
_UIA_Action($oUIElement, "setfocus")
_UIA_Action($oUIElement, "highlight")
_UIA_Action($oUIElement, "activate")
_UIA_Action($oUIElement, "leftclick")
Func MyExit()
Exit
EndFunc ;==>MyExit
````
Download historical data
button is not present in HTML, it's added later via Javascript and it generates CSV file on-the-fly (there's no network requests). This mean you cannot "click" it without loading the page in a browser. The easiest way I know is using Python to drive an actual (headless - i.e. without a visible window) browser and let it load the page and click the button for me. – abdusco