I’m using BeautifulSoup to parse the HTML you provided.
Then I navigate the soup using the spans. After I have the target element, I get the text of the element.
This finds all spans and selects the second one.
I have this additional code before calling either of those.
from bs4 import BeautifulSoup html = "<span class="posting-location go-to-posting">Santa Gertrudes , <span> Tatuapé, São Paulo</span></span>" soup = BeautifulSoup(html, 'html.parser')