Hi
I would like to extract one piece of information from HTML files saved on local hard disk. I have created a new UI element from one of the webpage. The information to be extracted is dynamic for each HTML file. Below are the codes. However, after the 2nd HTML file is opened, PAD gives the error of "Extraction failed (failed to get UI element) ". If I do not close the new tabs after each HTML file is opened, it will extract the same info from the same webpage where the UI element is created. Is there a solution?
PAD codes
Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: ExcelFileDirectory Visible: True ReadOnly: False Instance=> ExcelInstance
Excel.GetFirstFreeColumnRow Instance: ExcelInstance FirstFreeColumn=> FirstFreeColumn FirstFreeRow=> FirstFreeRow
LOOP LoopIndex FROM 1 TO FirstFreeRow - 1 STEP 1
Excel.ReadFromExcel.ReadCell Instance: ExcelInstance StartColumn: 1 StartRow: LoopIndex + 1 ReadAsText: True CellValue=> ExcelData
WebAutomation.LaunchEdge.LaunchEdge Url: $'''www.google.com''' WindowState: WebAutomation.BrowserWindowState.Maximized ClearCache: False ClearCookies: False WaitForPageToLoadTimeout: 60 Timeout: 60 BrowserInstance=> Browser
WebAutomation.CreateNewTab.CreateNewTab BrowserInstance: Browser Url: ExcelData WaitForPageToLoadTimeout: 60 NewBrowserInstance=> NewBrowser
UIAutomation.ExtractDataFromWindow.ExtractData Control: appmask['Window \'san ... - Microsoft​ Edge\' 2']['Text \'M286\''] ExtractedData=> DataFromWindow
Excel.WriteToExcel.WriteCell Instance: ExcelInstance Value: DataFromWindow Column: FirstFreeColumn Row: LoopIndex + 1
MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: Browser TextToSend: $'''{LControlKey}({W})''' DelayBetweenKeystrokes: 10 SendTextAsHardwareKeys: False
END
# [ControlRepository][PowerAutomateDesktop]
{
"ControlRepositorySymbols": [
{
"IgnoreImagesOnSerialization": false,
"Repository": "{\r\n \"Screens\": [\r\n {\r\n \"Controls\": [\r\n {\r\n \"AutomationProtocol\": \"uia3\",\r\n \"ScreenShot\": \"a/FA+f5AdhWD5P7sPXI7gT/AAQEQkw/+zC0xFtv.......
"DisplayName": "Local computer",
"ConnectionString": "",
"Type": "Local",
"DesktopType": "local"
},
"Name": "appmask"
}
],
"ImageRepositorySymbol": {
"Repository": "{\r\n \"Folders\": [],\r\n \"Images\": [],\r\n \"Version\": 1\r\n}",
"ImportMetadata": {},
"Name": "imgrepo"
},
"ConnectionReferences": []
}