How to get the URL of a webpage?

Hello,

I am developing a process that automatically open a certain URL in the browser after clicking on a button.

Is there any good way to get such a URL ?

Thank you guys :smiley:

Hi,

Can you try Inject JS Script Activity with the following script code?

"function(e,v){return location.href;}"

We can get current url of browser.

Regards,

Please, could you provide me more details on how to do it?

I’d be very pleased if you could share the xaml.

Thanks in advance.

Hi,

Unfortunately, I cannot upload xaml file now because of my current environment.

Can you try the following steps?

  1. First, If you use Attach Browser, drag and drop Inject JS Script activity to Do of Attach Browser.

2.If you don’t use Attach Browser, drag and drop JS Script, click Indicate on Screen and indicate browser.

  1. Then set the following setting to Inject JS Activity
    Script Code:"function(e,v){return location.href;}"
    Output: Set GenericValue type variable (Let’s say result)

  2. We can get the URL using result.toString()

Regards,

Hello, thank you very much. I tried but th next error is shown:

Thanks.

Hi,

I’ll share a sample xaml file as the following. Can you check it?

Sequence.xaml (8.6 KB)

Regards,