object HTMLDivElement to string

How can one convert “object HTMLDivElement” to a string?

let z = document.querySelector(".global_all_sessions"); console.log(z) // No string

Tried to do so: z = String(z) , but it didn’t work out.