title: 'NoneType' object has no attribute 'text' in BeautifulSoup
body: <p>I am trying to scrape Google results when I search "<em>What is 2+2</em>", but the following code is returning <code>'NoneType' object has no attribute 'text'</code>. Please help me in achieving the required goal.</p>
  
  <pre><code>text="What is 2+2"
  search=text.replace(" ","+")
  link="https://www.google.com/search?q="+search
  headers={'User-Agent':'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36'}
  source=requests.get(link,headers=headers).text
  soup=BeautifulSoup(source,"html.parser")
  answer=soup.find('span',id="cwos")
  
  self.respond(answer.text)
  </code></pre>
  
  <p>The only problem is with <code>id</code> in <code>soup.find</code>, however I have chosen this id very closely. I shouldn't be mistaken. I also tried <code>answer=soup.find('span',class_="cwcot gsrt")</code>, but neither worked.</p>