kyle
February 19, 2020, 12:05am
1
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!
ulrich
February 19, 2020, 9:52am
2
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.
kyle
February 19, 2020, 2:11pm
3
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!
ulrich
February 19, 2020, 7:20pm
4
…and the goal is to extract the link?
kyle
February 19, 2020, 8:02pm
5
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
kyle
February 20, 2020, 4:44pm
6
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
kyle
February 20, 2020, 6:18pm
8
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.
kyle
February 20, 2020, 7:18pm
10
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
Hi @admin @Plankton @ulrich @thecoder2012
I tried to store href in a simple image but give me an error I can store alt but not store href.
Ui vision can store href from images and links ?
Why alt working but href not working ?
I tried this demo but do not work.
https://ui.vision/rpa/docs/selenium-ide/storeattribute
Thanks for help.
My macro code
{
"Name": "Store-href",
"CreationDate": "2020-2-21",
"Commands": [
{
"Command": "open",
"Target": "https://ui.vision/",
…
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…