input: Write a function to create a web scraper in Python that can extract hotel reviews from TripAdvisor. The function should make a request to a given URL, parse the HTML, find all review containers, and print the title and text of each review. If there are no reviews, it should simply print a message indicating that.
  
  import requests
  from requests.exceptions import RequestException
  from bs4 import BeautifulSoup
  
  def get_tripadvisor_reviews(url, headers=None):
      try:
          if headers is None:
              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'}
          
          # Make a request and get HTML in response
          response = requests.get(url, headers=headers)
          response.raise_for_status()
          
          # Parse HTML
          soup = BeautifulSoup(response.text, 'html.parser')
          
          # Find all reviews
          reviews = soup.find_all('div', {'class': 'review-container'})
          
          if not reviews:
              print("No reviews found.")
          else:
              # Go through every review and extract the data
              for review in reviews:
                  # Get the title
                  title = review.find('span', {'class': 'noQuotes'}).text
                  
                  # Get the text
                  text = review.find('p', {'class': 'partial_entry'}).text
                  
                  # Print for demo
                  print(title)
                  print(text)
                  print('-' * 50)
      except RequestException as e:
          print(f"An error occurred: {e}")
  
  assert get_tripadvisor_reviews('<valid_tripadvisor_reviews_url>') is None
  assert get_tripadvisor_reviews('<url_with_no_reviews>') is None
  assert get_tripadvisor_reviews('<invalid_url_format>') is None
output: def get_tripadvisor_reviews(url, headers=None):
      try:
          if headers is None:
              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'}
          
          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:
              print("No reviews found.")
          else:
              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 RequestException as e:
          print(f"An error occurred: {e}")