GET URL FROM WEB

Hi All,
I want extract url of pdf in the webpage. I have used GET ATTRIBUTE Activity, but i get only one link(URL). Some web pages contains more than one link(2,3,4…etc).
So how can i extract all the links.

Thanks in Advance
Muthu

These links likely have an idx attribute which you can use to iterate over all of the links. Use a While loop and continue increasing idx until the element for a link does not exist. For example, if there are 5 links, you start your index at 1, check if the link exists for index one, and since it does, get the URL. You’ll keep doing this until you check for idx 6 and find out that it doesn’t exist. Then you will break form the loop.

6 Likes

@muthu.m

I think you can try using this regex
(http|ftp|https)://([\w_-]+(?:(?:.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?
to get a list of all the URLs in the page.

2 Likes

Thanks for your response @SowmyaLeo @Anthony_Humphries

Hi @Anthony_Humphries,

Can u provide sample code Please.

Thanks in Advance
Muthu

Hi all,

=> @SowmyaLeo @sandeep13 @Anthony_Humphries

I’m trying to get url using “Get Attribute” activity, in the UiExplorer the value of idx is showing different value, its depends upon the details of the web page. Ex: idx=‘4’ / 'idx=‘7’.

So, am trying to find the text-heading “Attachments” by using "Find Text"Activity.
How should i get the idx values by finding the text heading.

Thanks in Advance,
Muthu

Take Get Attribute activity and select whole window.

and provide attribute as"url" and store the output in a variable.
image