input:                     
  
  def scrape_planet_data(url: str) -> list:
      """ Scrape the planets information (name, mass, and distance from the sun) from a given URL.
      >>> scrape_planet_data('https://en.wikipedia.org/wiki/List_of_gravitationally_rounded_objects_of_the_Solar_System')
      [{'name': 'Mercury', 'mass': '0.055 Earth masses', 'distance_from_sun': '57.9 million km'}, 
       {'name': 'Venus', 'mass': '0.815 Earth masses', 'distance_from_sun': '108.2 million km'}, 
       {'name': 'Earth', 'mass': '1 Earth masses', 'distance_from_sun': '149.6 million km'}, 
       {'name': 'Mars', 'mass': '0.107 Earth masses', 'distance_from_sun': '227.9 million km'}, 
       ...]
      """
      import requests
      from bs4 import BeautifulSoup
  
      page = requests.get(url)
      soup = BeautifulSoup(page.content, 'lxml')
  
      planets_table = soup.find('table', class_='wikitable sortable')
  
      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
output:     import re
  
      for planet in planets:
          planet['name'] = re.sub(r'\s*\[\d+\]\s*$', '', planet['name']).strip()
          planet['mass'] = re.sub(r'\s*\[\d+\]\s*$', '', planet['mass']).strip()
          planet['distance_from_sun'] = re.sub(r'\s*\[\d+\]\s*$', '', planet['distance_from_sun']).strip()
  
      return planets