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 URL from sourc...
Power Automate
Unanswered

Extract URL from source code

(0) ShareShare
ReportReport
Posted on by 3

Hello,
in my flow, I would like to extract the URLs from a webcode.

My thought was to use python for this.
If I use python like this, it's not a problem.
Jeodch I get the following error in the power automate destop.
Parameter "Python script to run": syntax error.

My code is:

 

import re

text = '''
Material:Stoff",null,"https://www.amazon.de/CLP-B%C3%BCrostuhl-Amadora-H%C3%B6henverstellbarer-Schreibtischstuhl/dp/B09BYKRHCQ",[52159,null,0,"52159.0",0,[52159]],"amazon.de",null,null,null,"https://www.amazon.de/CLP-B%C3%BCrostuhl-Amadora-H%C3%B6henverstellbarer-Schreibtischstuhl/dp/B09BYKRHCQ",2,null,"amazon.de",["https://encrypted-tbn1.gstatic.com/favicon-tbn?q\u003dtbn:ANd9GcSL_uMPFp73A3GdEq8WXVyN2LebRL8zMmALc7cQGONrtiAWNQAd-
'''

urls = re.findall('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\\(\\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', text)

for url in urls:
 print(url)

 

My guess is that it has to do with

urls = re.findall('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\\(\\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', text)


So, I hoppe that some one can help me. 
A Soloution with out using Python, would also be much appreciated.

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

    Use the Parse text action with "Is regular expression" toggle enabled and use the following regex pattern: http[^"]+

     

    Also make sure to set it to retrieve all results and not just the first one. This will return the URLs in a list variable.

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

    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/

     

  • Yonah_ Profile Picture
    3 on at

    Thanks
    And it works too.
    But since in the code also something like %3% or %c% occurs.
    I get an error message that a variable is not defined.
    But surely this can be switched off?

    Sorry, that I probably ask such a simple question.
    But I'm using Power Automate for the first time and have previously only worked with Power BI.
    So I have a lot to learn. 

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    The percentage symbol is used for variable notation in PAD. It needs to be escaped by either using \% or %%.

    However, I assume the value should be some kind of a dynamic input, right? If so, PAD shouldn't really care about percentage symbols. It only matters when you use a hard-coded value. But if you did that, you could simply hardcode the URLs right away, without the need to parse them?

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

    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/

     

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 258 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 198 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 136 Super User 2026 Season 2

Last 30 days Overall leaderboard