import requests
from bs4 import BeautifulSoup
url = 'http://example.com'
response = requests.get(url)
html_doc = response.text
soup = BeautifulSoup(html_doc, 'html.parser')
json_element = soup.find('script', {'type': 'application/json'})
json_data = json.loads(json_element.string)
print(json_data['result'])
以上就是将 Beautiful Soup 解析包含 JSON 的 HTML 的完整解决方法。