input: Write a function to implement a web scraper in Python to extract the top ten trending YouTube videos. The function should make a request to the YouTube trending page, parse the page content using BeautifulSoup, and print the titles of the top ten trending videos. If the page content does not contain enough videos, the function should handle this gracefully and print only the available videos.
  import requests
  from bs4 import BeautifulSoup
  
  def extract_trending_videos():
      # make a request to get the page content
      page = requests.get("https://www.youtube.com/feed/trending")
      
      # parse the page content
      soup = BeautifulSoup(page.content, 'html.parser')
      
      # extract the list of trending videos
      trending_videos = soup.find_all(class_='expanded-shelf-content-item-wrapper')
      
      # print the top ten trending videos
      for video in trending_videos[:10]:
          print(video.find(class_='yt-uix-tile-link').get('title'))
      
  assert extract_trending_videos() # Output will be the titles of the top ten trending videos or fewer if not enough videos are available.
output: 
  import requests
  from bs4 import BeautifulSoup
  
  def extract_trending_videos():
      page = requests.get("https://www.youtube.com/feed/trending")
      soup = BeautifulSoup(page.content, 'html.parser')
      trending_videos = soup.find_all(class_='expanded-shelf-content-item-wrapper')
      for video in trending_videos[:10]:
          print(video.find(class_='yt-uix-tile-link').get('title'))
  