How to capture an embedded link from outlook email

Dear Experts

I have an embedded link in outlook email need to be captured

I am not sure what is the correct way to do so

image

image

Once open the link in browser, I need to download this report to my local folder
Is there an easy way to do so without clicking here and there in browser?

Thank you for your advise in advance
Ivan

@yangyq10,

Extracting with regex is best approach I would say.

Regarding downloading the file, is it’s direct file download link, use Download file from URL activity

@ashokkarale May I know the regex in this scenario?

Its not a direct download link, I need to click more steps in Browser to do so

@yangyq10,

Use activity Find Matching Patterns which have URL pattern.

In this case UI interaction is the only option

@ashokkarale No idea how to use this activity [Find Matching Patterns] in my case :cry:

@yangyq10

  1. Get the body as html currentMail.BodyAsHTML will give it
  2. Use write text file activity and write the extracted body to text file and save as .html file
  3. Use application/browser and in arguments or file pth pass the saved file from step 2
  4. Use click activities to click on the url

Cheers

@yangyq10,

No problem use this expression in assign activity.

strURL = System.Text.RegularExpressions.Regex.Matches(currentMail.BodyAsHTML,"(?:(?:https?|ftp|file):\/\/|www\.|ftp\.)(?:\([-a-zA-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-a-zA-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-a-zA-Z0-9+&@#\/%=~_|$?!:,.]*\)|[a-zA-Z0-9+&@#\/%=~_|$])").First().Value.ToString

The image shows an assignment activity in a workflow that uses C# regular expressions to extract the first URL found in the HTML body of an email and assigns it to the variable "strURL". (Captioned by AI)

@Anil_G
I don’t quite understand step3. Can you help show more detail? Thanks


image

@yangyq10

pass the path here

The image shows a section of the UiPath Studio interface, specifically the parameters of an activity where the "Arguments" input field is circled. (Captioned by AI)

you can opne the file and use indicate to get a generic selector as well

cheers

@Anil_G

Can you help take a look why it doesn’t work? Thanks

l

@yangyq10

open the file and indicate the browser

cheers

@Anil_G

I don’t know how to open it with an error code…

image

@yangyq10

Open the file manually just double click

Then indicate the opened browser

Cheers

@Anil_G

[Click] can not be used…sigh…
image

@yangyq10

as mentioned in error go to UiPath extension in browser and enable file urls

cheers

@Anil_G

Thank you for the patience and guidance
Eventually I use below method to make it happen(only by UI click) :grinning:

1 Like

@yangyq10

Even that would work

But just rememeber its not good to perform ui automation on outlook

But glad you resolved

Cheers