Skip to main content

Notifications

Community site session details

Community site session details

Session Id : wu6ojhxSULE9bEXZ49u1s7
Power Automate - Power Automate Desktop
Unanswered

HTML dynamic Element selector

Like (0) ShareShare
ReportReport
Posted on 11 Nov 2022 09:47:24 by 20

I need to write starting and ending times to specific HTML elements, but company website uses dynamic HTLM selectors. 

 

Here are those two dynamic selectors

"Input 36"

<input required="required" id="input-36" type="text">
#input-36
document.querySelector("#input-36")
//*[@id="input-36"]
/html/body/form/div[3]/div/div[3]/div/div/div/main/div/div/div/div[3]/div/form/div/div[3]/div[1]/div[2]/div[1]/div[2]/div[1]/div/input

 

"Input 186"

<input required="required" id="input-186" type="text">
#input-186
document.querySelector("#input-186")
//*[@id="input-186"]
/html/body/form/div[3]/div/div[3]/div/div/div/main/div/div/div/div[3]/div/form/div/div[3]/div[1]/div[4]/div[1]/div[2]/div[1]/div/input

 

In both selectors the numbers are changing when opening a new page!

XPATH is different but PAD doesn't support that, or at least PAD gives error when I try using XPATH 

 

I found other difference, above actual HTLM selector is "label"

It has name for the field which is different for different selectors. They are "Loppuaika" and "Alkuaika"

 fugit185_0-1668159181570.png

 

<label for="input-186" class="v-label theme--light error--text" style="left: 0px; right: auto; position: absolute;">Loppuaika</label>
<label for="input-36" class="v-label theme--light error--text" style="left: 0px; right: auto; position: absolute;">Alkuaika</label>

 

But I have tried but not found way to use that label.

So is it possible to use that and then how to do it?

 

  • fugit185 Profile Picture
    20 on 16 Nov 2022 at 06:27:34
    Re: HTML dynamic Element selector

    could not get working, tried many times

  • momlo Profile Picture
    1,527 Super User 2024 Season 1 on 11 Nov 2022 at 12:49:38
    Re: HTML dynamic Element selector

    See if this approach helps, it's exactly about what you need to achieve - using labels for dynamic inputs:

    https://www.youtube.com/watch?v=Lpk35MeTgFA

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,670 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard
Loading started