<commit_before>import requests
from bs4 import BeautifulSoup
from urllib.parse import urljoin

url = 'https://afuntw.github.io/demo-crawling/demo-page/ex1/index1.html'
response = requests.get(url)
soup = BeautifulSoup(response.text, 'lxml')
answer = list()

# 取得頁面中的 h1 tag 並將結果存入 answer
h1 = soup.find_all('h1')
for tag in h1:
    answer.append(tag.text)

print(url)
print('answer: ', answer, '\n\n')
<commit_msg>modified: declare list by []<commit_after>import requests
from bs4 import BeautifulSoup
from urllib.parse import urljoin

url = 'https://afuntw.github.io/demo-crawling/demo-page/ex1/index1.html'
response = requests.get(url)
soup = BeautifulSoup(response.text, 'lxml')
answer = []

# 取得頁面中的 h1 tag 並將結果存入 answer
h1 = soup.find_all('h1')
for tag in h1:
    answer.append(tag.text)

print(url)
print('answer: ', answer, '\n\n')

{'fraction_non_alphanumeric': 0.14183551847437426, 'fraction_numerical': 0.0166865315852205, 'mean_word_length': 4.957446808510638, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3000672', 'n_tokens_mistral': 331, 'n_tokens_neox': 336, 'n_words': 73}