title: Python script to get temperature from google search
body: <p>I am making a python script which will get temperature from google by searching for keyword temperature.
  I have found that the value of temperature is stored in span id="wob_tm" from this inspect element code-></p>
  
  <pre><code>&lt;div&gt;
  &lt;div class="vk_bk sol-tmp" style="float:left;margin-top:-3px;font-size:64px"&gt;&lt;span id="wob_tm" class="wob_t" style="display:inline"&gt;
    18
  &lt;/span&gt;&lt;span id="wob_ttm" class="wob_t" style="display:none"&gt; … &lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>It can be seen that temperature 18 is inside span id="wob_tm".
  So ,my python script is-></p>
  
  <pre><code>    from bs4 import BeautifulSoup
  import requests,sys,webbrowser    
  
  str="temperature"
  res = requests.get('http://google.com/search?q=%s'%str)
  res.raise_for_status()
  examplesoup= BeautifulSoup(res.text,"lxml")    
  linkelems=examplesoup.findAll("span",{"id":"wob_tm"})
  print linkelems.string.strip()
  </code></pre>
  
  <p>It gives me this error-
  AttributeError: 'NoneType' object has no attribute 'string'
  How to correct it? That means that linkelems has no  elements.</p>