Get a text of an element in Safari webpage into variable

Guys, help! Trying to get a text "Pending (1)" into KM variable using JavaScript and document.querySelector(). When I using this script:
var divElement = document.querySelector('div.o_tabs_theme_label')
I getting "To submit (1)" element, but I need "Pending (1)", I think it happens because this two element have different data-reactid, but I have no idea how to add that parameter to document.querySelector('div.o_tabs_theme_label')
Any ideas?

I think this can be done, but I need you to post the actual HTML code you show in the screen shots, using Code Block.