title: I'm getting AttributeError: 'NoneType' object has no attribute 'find'
body: <p>Hi this is a my code to retrieve the first topic in the <code>ycombinator</code> website. When I run the code I get- </p>
  
  <pre><code>AttributeError: 'NoneType' object has no attribute 'find'for the line 
  level2= data.level1.find('table',attrs = {'id':'hnmain'})
  </code></pre>
  
  <p>The topics are nested deep within various tags which is why I proceeded as below. I'm just doing this for practice so I know this might not be the best way to code as its my first day and I just want to know how to get past the error.   </p>
  
  <pre><code>import requests
  from bs4 import BeautifulSoup
  response1= requests.get('https://news.ycombinator.com/')
  response = response1.text
  
  data = BeautifulSoup(response,"html.parser")
  
  level1= data.body.find('centre')
  level2= data.level1.find('table',attrs = {'id':'hnmain'})
  level3= data.level2.find('tbody')
  level4= data.level3.find('tr')
  level5= data.level4.find('td')
  level6= data.level5.find('table.itemlist')
  level7= data.level6.find('tbody')
  level8= data.level7.find('tr#15426209.athing')
  level9= data.level8.find('td.title')
  level10= data.level9.find('a.storylink')
  print(level10.text)
  </code></pre>