alesh
November 18, 2019, 9:13pm
1
Has anyone/could anyone figure out a macro to automatically click those annoying Google Feeling Lucky redirect interstitial pages? (e.g. Redirect Notice )
This surely must be possible with KM's new XPath features, but it's beyond me.
Since many things you do happen in web pages these days, being able to automate them is quite useful.
The tricky bit with web pages is they tend to be quite fluid, the window size changes, and the contents of the window can move around quite a lot, and the window often scrolls, so identifying elements on the page can be quite tricky.
A good solution to this issue is using an XPath , which is like a file system path, but is the path through the Document Object Model (DOM) to the desired element. …
I've got a macro that says
IF Safari Activates
Pause for 1 second
IF the front window of Front Application TITLE IS "Redirect Notice"
then I just need it to click the first link on the page. Ideas?
Put this script in a Execute a JavaScript in Front Browser action
document.querySelector('a').click();
I have to say that there is some risk -- it is rare that you want the FIRST link on a page.
alesh
November 18, 2019, 10:08pm
3
Thanks, that works!
I'll share my macro tomorrow, apparently the forum thinks it's my first day so I'm limited to the one post.
alesh
December 5, 2019, 4:14pm
4
Finally got around to posting the macro, which has been working reliably:
I use a Google Feeling Lucky search template in Launchbar. Well, Google recently added an interstitial page for GFL links, and nobody is happy .
With some help , I built this action that auto-clicks the redirect link so it kinda-sorta works. The 1-second pause might need adjusting depending on your system.
Google Feeling Lucky redirect click Macro (v9.0.3)
Google Feeling Lucky redirect click.kmmacros (4.2 KB)
[image]