Get first part of a number in whatsapp web

Hi I use TextBlaze a lot.
When running Whatsapp web, I would like to get the first part of the telephone international code number of the active chat window so I can process it. (Image attached)

So supose the number is +1 777 5555 4444 TBlaze can write: "Hi... In the United States"....
supose the number is +54 777 5555 4444 TBlaze can write: "Hi... In Argentina"....
Regards

You can do that using the site command and a mapping of country codes to countries.

Something like the following might work. It assumes you only have one phone number on the screen. If you have multiple different ones you can look into the selector setting for the site command which can help you narrow it down.

Create a mapping of country codes to countries:
{cc_mapping=[
"+1"="The United States",
"+54"="Argentina"
]}

Get the country code from the page:
{cc=extractregex({site:text}, "(\+\d+) \d")}

Hi... In {=cc_mapping[cc]}

Thank You!
Can the info be mapped in a google sheet?

You could do that with the URLLoad command.

I wouldn't recommend it though as it would increase the latency of the snippet (needing to wait for the network request to load the spreadsheet).