title: AttributeError: 'NoneType' object has no attribute when I try to get values out of a table
body: <p>I try to scrape a website and get values out of a table using Python.
  This goes well until I want to grap the value only (so without the html).</p>
  <p>I try to get the value out of the field by using the following code:</p>
  <pre><code>from bs4 import BeautifulSoup
  from urllib.request import Request, urlopen
  import requests
  
  req = Request('https://www.formula1.com/en/results.html/2022/drivers.html', headers={'User-Agent': 'Mozilla/5.0'})
  webpage = urlopen(req).read()
  
  
  soup = BeautifulSoup(webpage,'html.parser')
  
  
  drivers = soup.find('table',class_='resultsarchive-table').find_all('tr')
  
  for driver in drivers:
      rank = driver.find('td', class_='dark')
      first = driver.find('span',class_='hide-for-tablet')
      last = driver.find('span',class_='hide-for-mobile')
      print (rank)
  </code></pre>
  <p>When I use .text or .get_text() I get the error AttributeError: 'NoneType' object has no attribute  while the code above contains values.</p>
  <p>What do I do incorrect?</p>