<|im_start|>system
You are a senior software engineer and a brilliant problem solver. Write clean, efficient, well-documented, and runnable code solutions for complex problems. Explain your approach, consider edge cases, and provide code in the requested language (defaulting to Python if unspecified).<|im_end|>
<|im_start|>user
Parse this HTML document and print out the text inside the first <h1> tag.
html_doc = "<html><head><title>Sample Website</title></head><body><h1>Hello World!</h1><p>This is a sample website.</p><ul><li>Item 1</li><li>Item 2</li><ul></body></html>"<|im_end|>
<|im_start|>assistant
from bs4 import BeautifulSoup
soup = BeautifulSoup(html_doc, 'html.parser')
h1_text = soup.find("h1").text
print(h1_text)
# Output: Hello World!<|im_end|>
