input: Write a function to retrieve the latest stock prices from specified websites using Python's web scraping tools. The input will be a list of stock names, and the function should return the price of each stock. If the function fails to retrieve the price, it should return None.
  def get_stock_price(stock):
      url = f"https://finance.yahoo.com/quote/{stock}"
      response = requests.get(url)
      soup = BeautifulSoup(response.text, 'html.parser')
      price = soup.find('div', {'class': 'My(6px) Pos(r) smartphone_Mt(6px)'}).find('span').text
      return price
  assert get_stock_price("AAPL stocks") is not None
  assert get_stock_price("ABCDEF stocks") == None
output: def get_stock_price(stock):
      url = f"https://finance.yahoo.com/quote/{stock}"
      try:
          response = requests.get(url)
          soup = BeautifulSoup(response.text, 'html.parser')
          price = soup.find('div', {'class': 'My(6px) Pos(r) smartphone_Mt(6px)'}).find('span').text
          return price
      except:
          return None