Skip to main content

Notifications

Community site session details

Community site session details

Session Id : H82LVOitD0xtknt19PkbOl
Power Automate - Power Automate Desktop
Answered

Extract data from web page doesn't show Href option

Like (0) ShareShare
ReportReport
Posted on 20 Sep 2023 11:16:42 by 167

Hello everyone

 

I am new to Power Automate and I am trying to scrape information from a list of websites. I have been using Extract data from web page action and it has been working, but for this particular website (https://www.cnsf.com.pt/divulgacao) I was able to get the text of each point of each dropdown menu but I am not having success extracting the Href from each one as I did for the text. It doesn't show me any Href option as it did in other websites, even when selecting different sections. I just want to select each one and extract the Href to a Datatable.

 

In the pictures I show the items where I want to extract the Href from and what I see when I try to do it.

If anyone knows how to help for this specific case I would really appreciate it. Thanks in advance.

  • TelmoERF96 Profile Picture
    167 on 21 Sep 2023 at 14:49:24
    Re: Extract data from web page doesn't show Href option

    Thank you so much Agnius, you have been amazing in helping, really well explained to someone who is just starting.

    Once again thank you, you are a lifesaver đź™Ź

  • Verified answer
    Agnius Bartninkas Profile Picture
    10,045 Most Valuable Professional on 21 Sep 2023 at 14:43:29
    Re: Extract data from web page doesn't show Href option

    You need to use the Live web helper to extract all the values into a list first like this:

    Agnius_0-1695307134159.png

     

    When you've done that, and click on Advanced settings, you'll see it is being extracted as a list:

    Agnius_1-1695307189441.png

     

    You then need to modify the CSS selector appropriately by either deleting the extra element, or adding it, depending on what you captured.

    I actually captured the paragraph parent (<p>) as it seemed to be easier to do. The parent still does not have any href, but it also returns an empty CSS selector field. If you captured the child <div> you might see something like this in the CSS selector field:

    Agnius_2-1695307311455.png

     

    But the result you want is actually only the <a> element in the CSS selector field, and "href" as the attribute you want to extract:

    Agnius_3-1695307373449.png

     

    Here's a copy of the action that you can simply paste into PAD to have it created for you:

    WebAutomation.ExtractData.ExtractList BrowserInstance: Browser Control: $'''html > body > div:eq(0) > div > div:eq(1) > div > main > div:eq(3) > div:eq(0) > div:eq(1) > div:eq(1) > div:eq(1) > div > div > div > div > div:eq(0) > p''' ExtractionParameters: {[$'''a''', $'''Href''', $''''''] } PostProcessData: False TimeoutInSeconds: 60 ExtractedData=> DataFromWebPage
    

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • TelmoERF96 Profile Picture
    167 on 21 Sep 2023 at 13:24:11
    Re: Extract data from web page doesn't show Href option

    I did make it work but only for the first menu, I am having trouble with the second and the remaining ones since I'm not able to find an element to get the HRef. It works as I said before by going to Advanced Options and manually changing the CSS selector to the corresponding element, but it still doesn't allow me to select more than one. Once I select a second instance using that same method the first one is overridden by it. You have been extremely helpful so far, thank you so much once again, but are you able to help me with this problem?

  • Agnius Bartninkas Profile Picture
    10,045 Most Valuable Professional on 21 Sep 2023 at 11:02:51
    Re: Extract data from web page doesn't show Href option

    Cool. Glad to hear you got it to work.

    As for using the Advanced options to get a list of values, you would need to change the data that you are trying to capture from a single value to a list/table. You would then get extra CSS selectors to define.

    If you capture it as a list first and then click on Advanced to modify, it's a bit easier.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • TelmoERF96 Profile Picture
    167 on 21 Sep 2023 at 10:42:18
    Re: Extract data from web page doesn't show Href option

    Hello Agnius, thank you for your answer

     

    It worked! You were right, I was able to find an <anchor> element and from there select the HRef option from the information. I also tried using the Advanced Options and do it how you explained and, although it sort of worked, I was only able to extract one link, whenever I tried to select a second one it would just replace the first and leave me with just one. Do you know how could I select all of them through the Advanced options like you said? I would really appreciate it.

     

    Thanks once again,

    Telmo Ferreira

  • Verified answer
    Agnius Bartninkas Profile Picture
    10,045 Most Valuable Professional on 21 Sep 2023 at 07:07:02
    Re: Extract data from web page doesn't show Href option

    This is because you're targeting the wrong element. The <span> element that holds the text does not have a href. It's the parent <a> element that includes the date AND the text that has the href behind it:

    Agnius_0-1695279956780.png

    Try capturing the entire row and then the href option will appear. If you are not able to capture that via the helper, try to capture the <span> element, but then go to the Advanced options and remove the span part at the end of the selector to focus on the <a> element.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

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!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Power Automate Desktop

#1
eetuRobo Profile Picture

eetuRobo 4 Super User 2025 Season 1

#2
KO-05050229-0 Profile Picture

KO-05050229-0 2

#2
stampcoin Profile Picture

stampcoin 2

Overall leaderboard
Loading started