title: trying to test a code that scrape from yahoo finance
body: <p>I'm a python beginner but I like to learn the language by testing it and trying it.</p>
  <p>so there is a yahoo web scraper code to scrape the last price of a specific stock, but it doesn't work with me I don't know the problem.</p>
  <p>..</p>
  <p>The code :</p>
  <pre><code># -*- coding: utf-8 -*-
  import bs4
  import requests
  from bs4 import BeautifulSoup
  
  
  def parsePrice():
      r = requests.get('https://finance.yahoo.com/quote/fb?p=FB')
      soup = bs4.BeautifulSoup(r.text,&quot;xml&quot;)
      price = soup.find('div', {'class':'My(6px) Pos(r) smartphone_Mt(6px)'}).find('span').text
      return price
  
  while True:
      print('the current price: '+str(parsePrice()))
  </code></pre>
  <p>error :</p>
  <pre><code>price = soup.find('div', {'class':'My(6px) Pos(r) smartphone_Mt(6px)'}).find('span').text
  AttributeError: 'NoneType' object has no attribute 'find'
  </code></pre>
  <p>maybe it's an easy thing but remember I'm a beginner.</p>
  <p>Thanks in advance</p>