<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Exercise 01
Step1:  Select one of those files to use as an example, and take a look at its HTML content.
Step2:  Next, use Beautiful Soup to extract text out of the HTML. Following the DOM structure of the HTML document, select the &lt;div/&gt; that encloses the article text, then iterate through the &lt;p/&gt; paragraphs to extract the text from each.
<ASSISTANT_TASK:>
Python Code:
%sx ls html/
Explanation: Exercise 01: extract text from HTML
The course repo has a subdirectory called html which includes some example HTML files.
End of explanation
file = "html/article1.html"
print(open(file, "r").readlines())
Explanation: Select one of those files to use as an example, and take a look at its HTML content.
End of explanation
from bs4 import BeautifulSoup
with open(file, "r") as f:
  soup = BeautifulSoup(f, "html.parser")
  for div in soup.find_all("div", id="article-body"):
    for p in div.find_all("p"):
      print(p.get_text(), "\n")
Explanation: Next, use Beautiful Soup to extract text out of the HTML. Following the DOM structure of the HTML document, select the &lt;div/&gt; that encloses the article text, then iterate through the &lt;p/&gt; paragraphs to extract the text from each.
End of explanation
<END_TASK>