Scraping URL from Salesforce Button

I’m trying to get an URL from a button in Salesforce but I’m having a very hard time with this.

Inspecting the button in Chrome, this is what I get:
<input value=“Link CMDB” class=“btn” name=“weg_linkcmdb” onclick=“if (window.invokeOnClickJS_00b1C000001dbiA) window.invokeOnClickJS_00b1C000001dbiA(this); else if (parent.window.invokeOnClickJS_00b1C000001dbiA) parent.window.invokeOnClickJS_00b1C000001dbiA(this); return false” title=“Link CMDB” type=“button”

How do I get an URL from this?
I’m sorry if I’m posting this in the wrong section of the forum.

It seems the link is dynamically created using Javascript.

Did you try with storeAttribute | linkText=ABC@href ?

If the Selenium IDE-style store attribute command fails you can use XClick to simulate a right-click and select “Copy link address”.


is it possible to add ‘pos=’ to this line?

Want to extract href of 2nd ‘ABC’

Hi, thank you for your reply!

So, if the link is dynamically generated, isn’t there a way to scrape the URL? Unfortunately, I can’t use the XModules in the company PC. I managed to “smuggle” their zip installation files, but their installation always gets corrupted.

Not with linktext= but with xpath= (you still can not use @pos, but you can construct an XPath that matches the 2nd link)

Maybe there is. If the link is not directly in the HTML source, you can try with using executeScript and running some Javascript to grab it?

Or: Click the button, navigate to the URL, grab the URL from the browser address bar (!URL variable) and then go back.

Ohhh actually I forgot to explain everything.
The button opens up a new window, not a new tab.
Actually, I just want to keep the macro running on that new window, and then go back, but I can’t seem to switch windows with selectWindow, I can only switch tabs.
I tried using selectWindow | title=window title |, but it doesn’t work.
So I figured I could just grab the URL and open it as a new tab, but that is also not going so well.

so @pos cant be used with @attribute?