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 / Click link on webpage ...
Power Automate
Answered

Click link on webpage by text

(1) ShareShare
ReportReport
Posted on by 8

I am running into an issue where links change position on the page depending on how many devices are listed so selecting by UI element doesn't work as it won't be in the same row each time, when attempting to set it up with other selectors it doesn't appear that "name" or "text" is an option.  

 

How can I get this to identify the text of the link and select by that?

 

bruisingfour_0-1638374648408.png

 

 

bruisingfour_1-1638374676432.png

 

I have the same question (0)
  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    I don't know about that, but there is a move mouse to text on screen (OCR) action.  It will OCR the active window and move the mouse to the text you want; if it works.

  • Michael531 Profile Picture
    2 on at

    One workaround could be to loop through all elements with the given class/id and use Get details of a UI element to get "Own text". When it matches the value you are looking for you click the link.

     

    Like section[Class="top-bar-section"] a[Class="main-level"]:eq(%LoopIndex%)

     

    Use a danish version of the program but i guess you can see what i mean? 🙂

    Michael531_0-1638380364933.png

     

  • bruisingfour Profile Picture
    8 on at

    I like the idea of the OCR, but it doesn't seem to be working. 

     

    As far as looping through the page to find the link, I don't mind this approach, but can't follow this well enough with the current screenshot provided in Danish. Can someone help with this approach in English?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I have the same issue. What I use is the move mouse to text via OCR. It helps to use the setting to look in subregion of foreground window.

    This sounds very basic but I got a dry erase marker and put 2 dots on my screen in the area I know the text should appear. Then I go back to PAD. Open "move mouse" and move my cursor to the dots. I write down the X and Y points for each dot. Then I cancel out of "move mouse" because it was just to notate the points. I go back to my OCR box and fill the points in for the subregion. Also, increase the tolerance to 2 or 3.

  • Li_Xianhua Profile Picture
    2 on at

    I see your UI element is: td:eq(5) > a[id=Row2Col2] , the up level tag <tr>'Row2' you haven't select.

    To use the method provide by @Michael531, depends on the webpage's structure, the number in the html structure need to replace to %LoopIndex%,

    could be like this:

            td:eq(%loopIndex%) > a

    or     td:eq(5) > a[id=Row%loopIndex%Col2]

    or     tr[id=Row%loopIndex%] > td:eq5 > a

    you could locate the element on the webpage's structure by right click on the element, select "Inspect".

     

    for the structure: 

    if a html is like below:

    <tr>

       <td>1

            <td>2</td>

            <td>3</td>

       </td>

       <td>4</td>

    <tr>

    you could locate the td with:

    1st td: tr > td:eq(0)

    2nd td: tr > td > td:eq(0)

    3nd td tr > td > td:eq(1)

    4th td tr > td:eq(1)

  • Highboy Profile Picture
    1,187 Super User 2024 Season 1 on at

    Could you please open the webpage, and press ctrl+shift+i 
    Then click on the "select element in page to inspect" (marked by the red arrow)  and click on the UI you want.
    Take a screen shot and post it here.

     

    There are many times where PAD sucks at getting all the good stuff you can use to identify a UI correctly.

    Highboy_0-1638529275410.png

     

  • Verified answer
    Henrik_M Profile Picture
    2,021 Super User 2024 Season 1 on at
    1. Click the toggle at the bottom of the selector builder so it's gray.
    2. Write a:contains("UCMobile") as selector (or whatever you want the link to contain.
    3. Update.
  • bruisingfour Profile Picture
    8 on at

    This worked perfectly and is an extremely easy update requiring no additional code added into the script!

     

    Why doesn't Microsoft make this information more readily available?!

     

    Thank you Henrik_M!

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 223

#2
David_MA Profile Picture

David_MA 210 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 175

Last 30 days Overall leaderboard