title: Use Python to collect weather data and write to file
body: <p>I would like your advice/help on this:</p>
  
  <p>Create a python script that:</p>
  
  <ul>
  <li>Every hour collect the <strong>temperature</strong> (e.g. 29<sup>o</sup>C) and <strong>current condition</strong> (e.g. Clear) from this website: <a href="http://www.wunderground.com/global/stations/54511.html" rel="nofollow">http://www.wunderground.com/global/stations/54511.html</a></li>
  <li>Create a CSV file with three headers: 
  
  <ul>
  <li>Datetime <em>(timestamp of data captured)</em></li>
  <li>Current Condition</li>
  <li>Temperature</li>
  </ul></li>
  </ul>
  
  <p>Add the data collected from the website into a new line of the CSV file.</p>
  
  <p>Rules:</p>
  
  <ul>
  <li>The script must  be running on your computer automatically for 5 days.</li>
  </ul>
  
  <p>Do you have some advice? :(</p>
  
  <p>I appreciate your help on this.</p>
  
  <p>I tried this : </p>
  
  <pre><code>import urllib2
  import cookielib
  
  cookieJar = cookielib.CookieJar()
  opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookieJar))
  
  setURL = 'http://www.wunderground.com/global/stations/54511.html?MR=1'
  request = urllib2.Request(setURL)
  response = opener.open(request)
  
  url = "http://www.wunderground.com/global/stations/54511.html?MR=1"
  request = urllib2.Request(url)
  page = opener.open(request)
  
  WeatherData = page.read()                            
  print WeatherData
  </code></pre>
  
  <p>So it print all the data but I want to print only the :</p>
  
  <p>Datetime <em>(timestamp of data captured)</em>
     - Current Condition
     - Temperature</p>
  
  <ul>
  <li><p>like I said need advice.like :</p>
  
  <ul>
  <li><p>what should I use to complete this task.</p></li>
  <li><p>How can set the data collect for (days), I don't know.. </p></li>
  </ul></li>
  </ul>
  
  <p>I don't need the full answer and copy paste, I'm not fool...</p>
  
  <p>I want to UNDERSTAND.</p>