input: Write a function to scrape the table at the given URL and extract the planets' information (name, mass, and distance from the sun). If the table is not found or the URL is invalid, the function should return an empty list.
  import requests
  from bs4 import BeautifulSoup
  
  def scrape_planets_info(url):
      try:
          page = requests.get(url)
          page.raise_for_status()
      except requests.RequestException:
          return []
      
      soup = BeautifulSoup(page.content, 'lxml')
      planets_table = soup.find('table', class_='wikitable sortable')
      
      if not planets_table:
          return []
      
      planets = []
      for row in planets_table.find_all('tr'):
          if row.find('th'):
              continue
          cells = row.find_all('td')
          planets.append({
              'name': cells[0].text,
              'mass': cells[2].text,
              'distance_from_sun': cells[5].text
          })
      
      return planets
  
  assert scrape_planets_info('https://en.wikipedia.org/wiki/List_of_gravitationally_rounded_objects_of_the_Solar_System') != []
  assert scrape_planets_info('invalid_url_here') == []
  assert scrape_planets_info('https://en.wikipedia.org/wiki/Non_Existent_Page') == []
output: 
  def scrape_planets_info(url):
      try:
          page = requests.get(url)
          page.raise_for_status()
      except requests.RequestException:
          return []
      
      soup = BeautifulSoup(page.content, 'lxml')
      planets_table = soup.find('table', class_='wikitable sortable')
      
      if not planets_table:
          return []
      
      planets = []
      for row in planets_table.find_all('tr'):
          if row.find('th'):
              continue
          cells = row.find_all('td')
          planets.append({
              'name': cells[0].text,
              'mass': cells[2].text,
              'distance_from_sun': cells[5].text
          })
      
      return planets
  