How to get dynamic url

Hi,
Thanks for your reply.
But it did’t work.

Hi,

Thanks for your reply.
But it did’t work

@priyanka144

“Get Attribute” Activity should work. Can you explain how you are getting link fo different users? on a same page or something else?

I am generating a user’s name from a particular website. With each new User there will be a new link generated which i need to get to place it in my workflow.

Yes in that case “Get Attribute” with “Url” attribute should work. any sample url link ? or try with some delay before.

Please find sample url linkbelow.

@priyanka144

Check sample workflow and let me know it is working for you?

If works then modify it as per your need.

Get_attrib_href.xaml (10.4 KB)

Regards…!!
Aksh

Hi,
According to your workflow i getting error for attribute.
When i select url in “Get Attribute”, screen shot attached as below.


Use IE browser please and just let it run as it is. change the browser in open browser property and let me know :slight_smile:

and do not re indicate it on url bar. just select the download image button. but if you will use IE then no need to change to see how it works.

In IE browser again show different error.

You have changed something? just reindicate it

Yes, I changed in “Ger Attribute”.:slight_smile:
First i indicate url bar and now i indicate download button in Get Attribute.
Actually i want to get downloaded image path from download folder.

:fearful: Not the image link available for download?

Yes.Image link is available but i am not getting that link.

ok so you wants that image link in anchor tag? sorry i was getting it wrong with the question title.

It’s ok…:slight_smile:
But now how to get that link,because it’s generate every time different url.

You can use Inject js activity to inject javascript code. In my chrome Uipath explorer is not identifying the elements so can no post .xaml and in IE this is not working but chrome this is working on that download page you can test it with browser developer console.as well.
document.querySelector(’.updown_pan a’).href;

If you are able to detect the element in your chrome then just add inject js activity with following code in a test.js file and writeline its output you will get it.

function(e) {
 var img_link = document.querySelector('.updown_pan a').href;
   return img_link;
};

Regards…!!
Aksh

Hi Aksh,
I injected javascript code as u told. It worked well. Thanks :slight_smile: but the issue is it is working fine for the first time in for each loop but when it goes to next row it gives the error regarding Image not found. In console log when I try to use that js code it is giving the same url which is opened.

Hi Aksh,
Is there any solution related to the above issue? If so , Please let me know…
Thanks

I am not getting this part @priyanka144 and in Exception message box i can see that names pictures of priyanka is loading so it is returning the old one. so put some delay to load an image and its download link with that new url.