How to Store HREF that changes every time

Hi all,

I’m trying to grab the link inside the HREF, the number string in this changes every time the page is loaded. I’ve tried to use the storeAttribute but it does not work. How can I grab this?

<a download="test_download_link" target="_blank" href="blob:https:/test.com/12456789"><span><i class="1ab1a2_test_class"></i></span></a>

Thanks!

Hi… what part changes? download="test_download_link" or <i class="1ab1a2_test_class">?

Maybe post 2…3 versions, then we see how it changes.

Hi Ulrich, thanks for responding!

It’s the HREF that changes… so it’d be something like

href=“blob:https:/test.com/1111112727”
Then
href=“blob:https:/test.com/738137aag2ha”

Everything else stays the same

Thanks!

…and the goal is to extract the link?

That’s right, I’d like to grab what’s wrapped in the quotations for href.

I’ve tried using storeAttribute, store, etc. but none of it seems to work… Sorry if this is a trivial request, I’m fairly new to this!

When I’m using the recorder and I click the actual link here is what appears in the target box:
xpath=//*[@id="app"]/div[2]/div/div[1]/div/div[2]/div[2]/div/div

Thanks again Ulrich

Hi Ulrich, sorry to bug you. I’m really stuck on this atm, any help is appreciated! Thank you

Post page url otherwise it’s hard to help you

The platform is outreach.io, I cannot paste the page URL as it requires a login.

I can not see the page you can this in this mode

{
  "Command": "storeAttribute",
  "Target": "xpath=//*[@id=\"app\"]/div[2]/div/div[1]/div/div[2]/div[2]/div/div@href",
  "Value": "Variable"
}

It’s very hard sotre href in some cases.

Thanks for helping out!

I added the @href to the end and it throws the error

[info] Executing: | storeAttribute | xpath=//*[@id=“app”]/div/div/div/div[1]/div/div/div/div/div/div/div/div/div/div/div[2]/div/div/div[1]/div/div[2]/div/a/span/i@href | !clipboard |

[error][ignored] missing attribute ‘href’

There is a bug in ui vision and will be fixed in new updates actually you can not store href from an image

Read here

I create an alternative solution for you, need to have installed xmodules

This is the code working better with firefox use desktop emulation

{
  "Name": "Store-href",
  "CreationDate": "2020-2-21",
  "Commands": [
    {
      "Command": "XClick",
      "Target": "xpath=//*[@id=“app”]/div/div/div/div[1]/div/div/div/div/div/div/div/div/div/div/div[2]/div/div/div[1]/div/div[2]/div/a/span/i",
      "Value": "#right"
    },
    {
      "Command": "pause",
      "Target": "3000",
      "Value": ""
    },
    {
      "Command": "XType",
      "Target": "z",
      "Value": ""
    }
  ]
}

Working well on firefox, if not working for you need to find a correct xpath for your element but i can not see the url of the page.

Maybe just grab the source code and pull out the href using something like:

<a\s+(?:[^>]?\s+)?href=(["’])(.?)\1

It’s a little clunky, but is one way to work around…