Grab text from webpage in Google Chrome

I am new to Keyboard Maestro so go easy on me lol. I need to grab a number from an element on google chrome. This is for work so I can't share the HTML directly but I can say:

When I run this in the console I return the correct information

var tracking = document.querySelector('code.milli.tid-tracking-number')

When I run this Macro I return Nothing.

What am I doing wrong?

Hey Brandon,

See the bottom of this thread.

Bug? Execute Javascript in browser

Also -- try the macro when Chrome is already running and frontmost to make sure you're not having a timing problem.

If neither of these solves your issue then report back, and we'll look further.


enabling Javascript worked thanks

1 Like