input: Write a function to create a web scraper in Python that extracts hotel reviews from TripAdvisor. If the URL is valid and the review data is present, the function should print the title and text of each review. If the URL is invalid or no reviews are found, the function should return 'No reviews found'.
  
  from bs4 import BeautifulSoup
  import requests
  
  def scrape_tripadvisor_reviews(url):
      headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36'}
      try:
          response = requests.get(url, headers=headers)
          response.raise_for_status()
          soup = BeautifulSoup(response.text, 'html.parser')
          reviews = soup.find_all('div', {'class': 'review-container'})
          if not reviews:
              return 'No reviews found'
          for review in reviews:
              title = review.find('span', {'class': 'noQuotes'}).text
              text = review.find('p', {'class': 'partial_entry'}).text
              print(title)
              print(text)
              print('-' * 50)
      except requests.exceptions.RequestException as e:
          return 'No reviews found'
  
  assert scrape_tripadvisor_reviews('https://www.tripadvisor.com/Hotel_Review-g60763-d1218720-Reviews-The_Boxer-Boston_Massachusetts.html') is None
  assert scrape_tripadvisor_reviews('https://www.tripadvisor.com/nofound') == 'No reviews found'
  assert scrape_tripadvisor_reviews('https://www.non_existent_site.com') == 'No reviews found'
  assert scrape_tripadvisor_reviews('https://www.tripadvisor.com/invalid_url') == 'No reviews found'
output: from bs4 import BeautifulSoup
  import requests
  
  def scrape_tripadvisor_reviews(url):
      headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36'}
      try:
          response = requests.get(url, headers=headers)
          response.raise_for_status()
          soup = BeautifulSoup(response.text, 'html.parser')
          reviews = soup.find_all('div', {'class': 'review-container'})
          if not reviews:
              return 'No reviews found'
          for review in reviews:
              title = review.find('span', {'class': 'noQuotes'}).text
              text = review.find('p', {'class': 'partial_entry'}).text
              print(title)
              print(text)
              print('-' * 50)
      except requests.exceptions.RequestException as e:
          return 'No reviews found'