input: Write a function to create a web scraper using Python that retrieves the 10 most recent articles from a given news website URL. The function should print the text of each article. If the URL is invalid or the website does not contain articles, an appropriate error message should be printed.
  def get_recent_articles(URL):
      try:
          html_content = requests.get(URL).text
          soup = BeautifulSoup(html_content, "lxml")
          articles = soup.find_all('article')
          if len(articles) == 0:
              print("No articles found on the page.")
          else:
              for article in articles[:10]:
                  print(article.text)
      except requests.exceptions.RequestException as e:
          print(f"An error occurred: {e}")
  
  assert get_recent_articles("http://example.com/validnews") == None
  assert get_recent_articles("http://example.com/nonarticlespage") == None
  assert get_recent_articles("http://nonexistentwebsite.com") == None
output: def get_recent_articles(URL):
      try:
          html_content = requests.get(URL).text
          soup = BeautifulSoup(html_content, "lxml")
          articles = soup.find_all('article')
          if len(articles) == 0:
              print("No articles found on the page.")
          else:
              for article in articles[:10]:
                  print(article.text)
      except requests.exceptions.RequestException as e:
          print(f"An error occurred: {e}")