input: Write a function to parse HTML and remove all script and style elements using BeautifulSoup.
  assert parse_html_remove_scripts_styles("<html><head><title>Test</title><style>body {background-color: #fff;}</style></head><body><h1>Heading</h1><script>alert('test');</script><p>Paragraph.</p></body></html>") == "Test\nHeading\nParagraph."
  assert parse_html_remove_scripts_styles("<html><body><p>Paragraph 1.</p><p>Paragraph 2.</p><style>.some-style {}</style><script>console.log('test');</script></body></html>") == "Paragraph 1.\nParagraph 2."
  assert parse_html_remove_scripts_styles("<html><head><title>Example</title></head><body><h1>Example Title</h1><p>This is a paragraph.</p></body></html>") == "Example\nExample Title\nThis is a paragraph."
output: def parse_html_remove_scripts_styles(html):
      from bs4 import BeautifulSoup
  
      soup = BeautifulSoup(html, 'html.parser')
  
      # Remove all script and style elements
      for script_or_style in soup(["script", "style"]):
          script_or_style.decompose()
  
      # Get the text
      text = soup.get_text()
  
      # Remove leading/trailing whitespace on each line and filter out empty lines
      lines = (line.strip() for line in text.splitlines())
      text = '\n'.join(line for line in lines if line)
  
      return text