web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Extract data from loca...
Power Automate
Unanswered

Extract data from local html files

(0) ShareShare
ReportReport
Posted on by 8

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": []
}

 

 

 

 

I have the same question (0)
  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    If the files are local, you can read them as text files using Read text from file action and then use Parse text with regular expressions to retrieve the data you need. No need to open the file in a browser at all. Will be much more stable and efficient.

     

    -------------------------------------------------------------------------

    If I have answered your question, please mark it as the preferred solution.

    If you like my response, please give it a Thumbs Up.

     

    If you are interested in Power Automate, you might want to follow me on LinkedIn at https://www.linkedin.com/in/agnius-bartninkas/

     

  • winfs Profile Picture
    8 on at

    the info to be extracted from each html file is dynamic and different. I do not know the exact text as the webpage generates it. I only know the info is displayed on a specific location on the webpage.   Therefore, the Parse text action could not be used

     

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Can you share some sample screenshots of the data you need to extract? Also, possibly the HTML text? It is very hard to comment on this without seeing the data.

     

  • winfs Profile Picture
    8 on at

    I found out that the data that I would like to extract is  located at "tbody tr.header td:nth-of-type(2)", which is the second td element within the tr element that has the class header.

     

    How could I use PAD to select the data?

     

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    As mentioned, I would need a screenshot or some sample of the HTML text to provide further help. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 269 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 184 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 136 Super User 2026 Season 2

Last 30 days Overall leaderboard