问题 EDIT: So I have save the script codes below to a text file but using re to extract the data still doesn't return me anything. My code is: file_object = open('source_test_script.txt', mode="r") soup = BeautifulSoup(file_object, "html.parser") pattern = re.compile(r"^var (chart[0-9]+) = new Highcharts.Chart\(({.*?})\);$", re.MULTILINE | re.DOTALL) scripts = soup.find("script", text=pattern) profile_text = pattern.search(scripts.text).group(1) profile = json.loads(profile_text) print profile[