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 return a list of the article texts.
  
  def scrape_news_articles(url):
      import requests 
      from bs4 import BeautifulSoup 
    
      # get the source code 
      html_content = requests.get(url).text 
    
      # parse the html content 
      soup = BeautifulSoup(html_content, "lxml") 
    
      # get all the articles  
      articles = soup.find_all('article') 
    
      # extract the text of the first 10 articles 
      article_texts = [article.text for article in articles[:10]]
    
      return article_texts
  
  assert scrape_news_articles('http://example.com/news')==['Article 1 text', 'Article 2 text', 'Article 3 text', 'Article 4 text', 'Article 5 text', 'Article 6 text', 'Article 7 text', 'Article 8 text', 'Article 9 text', 'Article 10 text']
  assert scrape_news_articles('http://example.com/anothernews')==['Another Article 1 text', 'Another Article 2 text', 'Another Article 3 text', 'Another Article 4 text', 'Another Article 5 text', 'Another Article 6 text', 'Another Article 7 text', 'Another Article 8 text', 'Another Article 9 text', 'Another Article 10 text']
  assert scrape_news_articles('http://example.com/emptynews')==[]
  assert scrape_news_articles('http://nonexistenturl')==[]
output: def scrape_news_articles(url):
      import requests 
      from bs4 import BeautifulSoup 
    
      try:
          html_content = requests.get(url).text 
          soup = BeautifulSoup(html_content, "lxml") 
          articles = soup.find_all('article') 
          article_texts = [article.text for article in articles[:10]]
      except:
          article_texts = []
    
      return article_texts