How to extract email from inspect element href

I am trying to extract email from the below href element


i tried to extract using the screen shot but does not seem to be working.

Thank you for the help in advance.


pattern = "agentemailaddress=(?<email>.+?)&"
email = Regex.Match(sample, pattern).Groups("email").ToString


You can look at what’s below (I didn’t test it).

myUri = New Uri("")
email = HttpUtility.ParseQueryString(myUri.Query).Get("agentemailaddress")

Did you mean URL?

Uri, that’s not a typo. An Url is a case of Uri.

i apologize.i am a new to uipath. This is way over my head at the moment. Can you please provide some detailed explanation as to what to do? Thank you for your help. Much appreciated.

no problem but I don’t have UiPath on this computer.

Each line is an Assign activity and the left side member of the equality is a String variable.

You can then use your write line activity with email variable.

This worked on my test run. Thank you much.

1 Like

Michael, i am now getting the error “HttpUtility is not declared, It may be inaccessible due to its protection level.”

Thanks, Richy.


import System.Web

I did but still does not seem to be working.


Hello @richygeorge

OK, I have the same problem in UiPath. Actually, when dealing with URL, I use Flurl library. You can add it to your dependencies from Manage Packages (see screenshot) then use the following lines

Assign (type Flurl.Url)
myUrl = New Flurl.Url("")

Assign (String)
email = myUri.QueryParams("agentemailaddress").ToString


Thank you. I will test.