Python BeautifulSoup HTML parse code select

You find a <tr> that contains the text "a steamID64" and find the <code> tag:

soup = BeautifulSoup(html, "html.parser")

print(
    soup.select_one("tr:-soup-contains('a steamID64') code").get_text(strip=True)
)

Output:

76561197960287930z