Email Click Hyperlink

I want my inbox to loop through emails and click the hyperlink “Download a copy”
I saw that need to create a regex and I am having trouble with that.

The address in the hyperlink is like this “http://wfgen/wfgen/show.aspx?QUERY=DATASET_FILE_DOWNLOAD&ID_PROCESS=533&ID_RELDATA=20807&ID_DATASET=50341692&NUM_VALUE=1

Where the 1692 in the back end of the url changes each time. Let me know if you need me to upload my project

The email looks like this

image

See below screenshot of my build

What is the current regular expression you are using? I personally like going to regexr.com, which lets you easily build and test regex expressions.

This pattern should work assuming the beginning and very end stay consistent:

"http://wfgen/wfgen.+VALUE=1"

So I changed it to what you provided below are my screenshots for matches activity. Don’t now if I did something wrong as it didn’t open url up.


image
image
image

Instead of using the regular expression activity, you can just write it all in one line like so. This will return the first found match. Use regex.matches instead if you’re expecting multiple hits.

system.text.regularexpressions.regex.match(ListMail(0).Body.ToString,"http://wfgen/wfgen.+VALUE=1").value
1 Like

Thanks I think that worked

1 Like

It doesn’t loop through when I use the open browser activity in my foreach statement

Sorry, can you be more specific? Are you expecting multiple URLs in each email?

If you’re expecting multiple URLs, you can use the for each statement, by saying for each match in system.text.regularexpressions.regex.matches(ListMail(0).Body.ToString,"http://wfgen/wfgen.+VALUE=1")

nvm I figured it out on my own now i had just entered that info in the match regex with variable called website

and then I used the open browser activity and used this website(0) seems to work properly now.

Thanks

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.