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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Selecting specific HTM...
Power Automate
Unanswered

Selecting specific HTML links to click

(0) ShareShare
ReportReport
Posted on by 64

Hi.  I have a webpage with multiple dynamic links on it that change everyday.  I would like to select and click specific links from the page, based off link name, but am having trouble writing a flow for this.  An example of the dynamic links looks like this...

PiperDan_0-1618477739151.png

 

Could someone please help me with selecting only the "Notice of Assessment" links and clicking only them.  I can run a flow to click every link but specific selection is where I am having trouble.  Thanks in advance.

I have the same question (0)
  • burque505 Profile Picture
    398 on at

    Are you able to post a screenshot or a copy of the element that contains "Notice of Assessment"?

    Take a look at this post on dynamic selectors also.

     

  • PiperDan Profile Picture
    64 on at

    Thank you for the quick response.  This is the element of the Notice of Assessment...

     

    > document[Class="Chrome_RenderWidgetHostHWND"] > table > custom:eq(0) > dataitem > group > group[Id="Main"] > group:eq(0) > table[Id="atoo-cch-ato-table-001"] > custom:eq(74) > dataitem[Name="Notice of assessment - Individual or Trust - EFT refund / Payment due"] > hyperlink[Id="atoo-cch-atolink-corres-21"]

     

    So judging by your posted link, I'm going to have to mess with UI Selectors and use the Name= as the defining element to distinguish between each link?

  • burque505 Profile Picture
    398 on at

    @PiperDan, that is what I would try if I were you.  This link on UI Elements may also help.

     

  • fraenK Profile Picture
    2,125 on at

    The easiest way would be to first extract a list of all links using: 

    https://docs.microsoft.com/en-us/power-automate/desktop-flows/actions-reference/webautomation#extractdata

    Then loop through the resulting list with a counter variable:

    https://docs.microsoft.com/en-us/power-automate/desktop-flows/actions-reference/loops#foreach

    https://docs.microsoft.com/en-us/power-automate/desktop-flows/actions-reference/variables#increasevariable

    If the text contains your key word then click the link, in the selector use ordinal for the <a> element and add the counter variable

    https://docs.microsoft.com/en-us/power-automate/desktop-flows/actions-reference/webautomation#clickbase

     

  • PiperDan Profile Picture
    64 on at

    Thank you for this @fraenK  You have put me on the right path.  However my skills are very elementary at this stage.  Could you post an image example for me of the For Each structure perhaps? 

     

    At the moment I have Extracted the data to a list variable and am running a For Each Loop over that list variable, but I have no idea what to put within the For Each Loop.  At the moment I have an IF %currentitem% contains Notice of Assessment write to Display Message (just wanted to see if I was on the right track), but it resulted in just looping through the list and not running the IF - no errors and no display message.

  • fraenK Profile Picture
    2,125 on at

    You need to have a look at the extracted data variable if it really contains the link titles

     

    Code could be:

    Set a counter variable to 0

    Extract the data

    for each

    if currentitem contains your keyword

    click the link with counter as ordinal value

    ....

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard