How to append scraped data efficiently into an array? (Python, BS4, Requests)
<p>I'm new to python and I'm trying to extract weather data using BeautifulSoup and Request. I have a question about the way arrays work in python and what the best way is to go about inserting the scraped data into a nicely formatted structure.</p>

<pre><code>    from lxml import html
    from bs4 import BeautifulSoup
    import requests

    url = "http://climate.weather.gc.ca/climateData/hourlydata_e.html?timeframe=1&amp;Prov=ON&amp;StationID=31688&amp;hlyRange=2002-06-04|2016-03-17&amp;Year=2016&amp;Month=3&amp;Day=15"
    r = requests.get(url)
    page = r.content
    soup = BeautifulSoup(page, "lxml")

    table = soup.find('table', class_='wet-boew-zebra span-8 ')
    rows = table.find_all('tr')

    data = []

   for item in rows:
        data.append(item.text)
   print data
</code></pre>

<p>My code is above, mainly the trouble I have is that at first I tried to do:</p>

<pre><code>    for item in rows:
        print(item.text)
</code></pre>

<p>I would see all the data as it is looping through the items. I then tried to do:</p>

<pre><code>    for item in rows:
        data = (item.text)
    print data 
</code></pre>

<p>This would only show the data from the last row of the table. I then tried to append (in the main code above) and get something like this:</p>

<blockquote>
  <p>[u"\n\nTemp Definition\xb0C\nDew Point Temp Definition\xb0C\nRel Hum Definition%\nWind Dir Definition10's deg\nWind Spd Definitionkm/h\nVisibility Definitionkm\nStn Press DefinitionkPa\nHmdx Definition\nWind Chill Definition\nWeather Definition\n", u' TIME     ', u'\n00:00\n9.5\n6.3\n81\nLegendMM\nLegendMM\n\n99.38\n\n\nLegendNANA\n', u'\n01:00\n9.0\n6.4\n84\nLegendMM\nLegendMM\n\n99.33\n\n\nLegendNANA\n', u'\n02:00\n8.0\n6.5\n91\nLegendMM\nLegendMM\n\n99.26\n\n\nLegendNANA\n', u'\n03:00\n7.6\n6.5\n92\nLegendMM\nLegendMM\n\n99.31\n\n\nLegendNANA\n', u'\n04:00\n7.2\n6.1\n93\nLegendMM\nLegendMM\n\n99.33\n\n\nLegendNANA\n', u'\n05:00\n7.1\n6.2\n94\nLegendMM\nLegendMM\n\n99.35\n\n\nLegendNANA\n', u'\n06:00\n7.6\n6.8\n95\nLegendMM\nLegendMM\n\n99.39\n\n\nLegendNANA\n', u'\n07:00\n7.6\n6.8\n95\nLegendMM\nLegendMM\n\n99.44\n\n\nLegendNANA\n', u'\n08:00\n\n\n\n\n\n\n\n\n\n\n', u'\n09:00\n7.3\n6.0\n92\nLegendMM\nLegendMM\n\n99.49\n\n\nLegendNANA\n', u'\n10:00\n7.4\n6.3\n92\nLegendMM\nLegendMM\n\n99.57\n\n\nLegendNANA\n', u'\n11:00\n7.3\n5.5\n88\nLegendMM\nLegendMM\n\n99.62\n\n\nLegendNANA\n', u'\n12:00\n7.7\n5.2\n84\nLegendMM\nLegendMM\n\n99.61\n\n\nLegendNANA\n', u'\n13:00\n7.9\n4.6\n80\nLegendMM\nLegendMM\n\n99.63\n\n\nLegendNANA\n', u'\n14:00\n9.6\n5.3\n75\nLegendMM\nLegendMM\n\n99.61\n\n\nLegendNANA\n', u'\n15:00\n10.0\n5.8\n75\nLegendMM\nLegendMM\n\n99.63\n\n\nLegendNANA\n', u'\n16:00\n10.0\n5.1\n72\nLegendMM\nLegendMM\n\n99.65\n\n\nLegendNANA\n', u'\n17:00\n9.6\n4.7\n72\nLegendMM\nLegendMM\n\n99.67\n\n\nLegendNANA\n', u'\n18:00\n8.6\n5.3\n80\nLegendMM\nLegendMM\n\n99.72\n\n\nLegendNANA\n', u'\n19:00\n7.9\n4.1\n77\nLegendMM\nLegendMM\n\n99.82\n\n\nLegendNANA\n', u'\n20:00\n7.9\n4.3\n78\nLegendMM\nLegendMM\n\n99.88\n\n\nLegendNANA\n', u'\n21:00\n7.7\n4.2\n79\nLegendMM\nLegendMM\n\n99.89\n\n\nLegendNANA\n', u'\n22:00\n7.4\n4.0\n79\nLegendMM\nLegendMM\n\n99.86\n\n\nLegendNANA\n', u'\n23:00\n7.1\n4.0\n81\nLegendMM\nLegendMM\n\n99.85\n\n\nLegendNANA\n']</p>
</blockquote>

<p>To summarize, what is the best way to insert data into an array where I can easily manipulate/analyze the data I scrape?</p>