How to target this element in DOM with Keyboard Maestro & save to variable

I'm wanting to target and grab into a variable the John Smith text within the screenshot. I'm hoping that someone will have the method here to achieve that, and I can learn for next time :slight_smile:

Without the actual HTML code, I can only make an educated guess at this. No guarantees.

Put this JavaScript in an Execute a JavaScript in Front Browser action

document.querySelector('div.rc-header__name').innerText;

IF everything is correct, it should return "JohnSmith"

If this does not work, you will need to post a large block of HTML code around the target line.

Worked first time! Legend!

1 Like

Wondered if you have any ideas on this one also? Executing Javascript for cycling through a list in chrome