I have a site that is behind a login, so I can't link right to it, but I'll try explain the problem.
On the right-hand side of each page is a list of "Tools" as shown here:
Until recently I was able to click that “E-mail” link by using “Click Safari link” but that is no longer working (the error message I get is "failed to find link 'E-mail').
I looked at the 'Inspector' to show the underlying HTML/JS which is here:
<a href="#" title="E-mail" class="email-link" data-panel="{"Id":"email","Url":"delivery/emailpanel","Js":"ep/controller/control/citationdeliverypanel.js"}">E-mail</a>
I also tried:
document.getElementById('email').click()
but that did not work either.
I tried “Click at found image” which only works once but when I close one tab and ask it to look again, for some reason it does not find it.
This is a key feature of something that I do multiple times per week (like 5-30 times each time I use it), so any help would be appreciated.
martin
March 15, 2021, 1:30am
2
Have you tried to copy any of these items in the Inspector?
Copy selector or Xpath will be two of the options.
See this:
copy xpath:
//*[@id="Column2Content"]/ul/li[4]/a
copy full xpath:
/html/body/form/div[2]/div[1]/aside/div/ul/li[4]/a
copy selector:
#Column2Content > ul > li:nth-child(4) > a
copy JS path
document.querySelector("#Column2Content > ul > li:nth-child(4) > a")
I'll tale a look at the macro you linked to. I don't even know what XPath is, to be honest.
(I used to know a lot about the web, but that was back when there was a lot less to know
Update!
Oh! This worked:
Execute JavaScript:
document.querySelector("#Column2Content > ul > li:nth-child(4) > a").click()
That looks absurd to me, but as long as it works, I'm happy to accept it
martin
March 15, 2021, 2:07am
4
Try:
document.querySelector("#Column2Content > ul > li:nth-child(4) > a”).click();
1 Like
Ha! I was literally posting that as you wrote it. Thanks!
(I don’t know why my previous post had a “smart” quote in the JavaScript, but I’ve fixed it.)
1 Like