import re
import json
from bs4 import BeautifulSoup
import requests
response = requests.get('https://www.kaggle.com/titericz')
soup = BeautifulSoup(response.content, 'html.parser')
pattern = re.compile('profile: ({.*}),', re.MULTILINE | re.DOTALL)
script = soup.find('script', text=pattern)
profile_text = pattern.search(script.text).group(1)
profile = json.loads(profile_text)
print(profile['ranking'], profile['rankingText'])
Python: получение текста из html с помощью Beautifulsoup