Get a text of an element in Safari webpage into variable

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.