input: Write a function to scrape the 10 most recent articles from a given news website URL using Python and the requests and BeautifulSoup libraries. The function should return a list of the titles of these articles.
  
  assert scrape_recent_articles('http://example.com/news') == ["Article Title 1", "Article Title 2", "Article Title 3", "Article Title 4", "Article Title 5", "Article Title 6", "Article Title 7", "Article Title 8", "Article Title 9", "Article Title 10"]
  assert scrape_recent_articles('http://anotherwebsite.com/news') == ["Another Title 1", "Another Title 2", "Another Title 3", "Another Title 4", "Another Title 5", "Another Title 6", "Another Title 7", "Another Title 8", "Another Title 9", "Another Title 10"]
  assert scrape_recent_articles('http://invalidurl.com') == []
  assert scrape_recent_articles('http://websitewithnoarticles.com') == []
output: def scrape_recent_articles(url):
      import requests
      from bs4 import BeautifulSoup
      try:
          response = requests.get(url)
          response.raise_for_status()
          soup = BeautifulSoup(response.text, 'html.parser')
          articles = soup.find_all('article')
          titles = [article.find('h2').text for article in articles[:10]]
          return titles
      except:
          return []