Retrieve URL of current Page

I’m looking for a way to save the URL of the page I am currently on to a variable. I’ve tried using a Switch-To-Window action to get the bot to view the browser as a program window so I can click into the URL entry bar and use a ctrl + C and a clipboard action to retrieve the URL, then using Switch To Browser to continue performing web actions, however this creates problems because every keyboard action I try to perform inside the subsequent Switch To Browser jumps back up to the URL bar rather than executing inside the website in the browser window.
Is there an easier way to extract the current URL without switching back and forth between window and browser actions?

Thanks

-Ethan Morris
RPath RPA Manager

1 Like

Hi @emorris try using XPath /html/head/link[@rel='canonical'] to save the URL.

Thanks, Alesia,
this should be a big help in some of my automations!
-Ethan Morris

RPath RPA Manager

1 Like