title: Python code doesn't retrieve all table data (Web scraping)
body: <p>I am trying to webscrape '<a href="https://www.timeanddate.com/time/dst/2018a.html" rel="nofollow noreferrer">https://www.timeanddate.com/time/dst/2018a.html</a>' in order to retrieve the information from the main table (3 columns - Date, Country, Local Time Change).
  I am using the following code but I get just the Date and the Country columns in my final table. Please help me retrieve Local Time Change column too.</p>
  
  <pre><code>BASE_URL=['https://www.timeanddate.com/time/dst/2018a.html']
  
  def table_to_2d(table_tag):
      rowspans = []  # track pending rowspans
      rows = table_tag.find_all('tr')
  
      # first scan, see how many columns we need
      colcount = 0
      for r, row in enumerate(rows):
          cells = row.find_all(['th', 'td'], recursive=False)
          # count columns (including spanned).
          # add active rowspans from preceding rows
          # we *ignore* the colspan value on the last cell, to prevent
          # creating 'phantom' columns with no actual cells, only extended
          # colspans. This is achieved by hardcoding the last cell width as 1. 
          # a colspan of 0 means “fill until the end” but can really only apply
          # to the last cell; ignore it elsewhere. 
          colcount = max(
              colcount,
              sum(int(c.get('colspan', 1)) or 1 for c in cells[:-1]) + len(cells[-1:]) + len(rowspans))
          # update rowspan bookkeeping; 0 is a span to the bottom. 
          rowspans += [int(c.get('rowspan', 1)) or len(rows) - r for c in cells]
          rowspans = [s - 1 for s in rowspans if s &gt; 1]
  
      # it doesn't matter if there are still rowspan numbers 'active'; no extra
      # rows to show in the table means the larger than 1 rowspan numbers in the
      # last table row are ignored.
  
      # build an empty matrix for all possible cells
      table = [[None] * colcount for row in rows]
  
      # fill matrix from row data
      rowspans = {}  # track pending rowspans, column number mapping to count
      for row, row_elem in enumerate(rows):
          span_offset = 0  # how many columns are skipped due to row and colspans 
          for col, cell in enumerate(row_elem.find_all(['td', 'th'], recursive=False)):
              # adjust for preceding row and colspans
              col += span_offset
              while rowspans.get(col, 0):
                  span_offset += 1
                  col += 1
  
              # fill table data
              rowspan = rowspans[col] = int(cell.get('rowspan', 1)) or len(rows) - row
              colspan = int(cell.get('colspan', 1)) or colcount - col
              # next column is offset by the colspan
              span_offset += colspan - 1
              value = cell.get_text()
              for drow, dcol in product(range(rowspan), range(colspan)):
                  try:
                      table[row + drow][col + dcol] = value
                      rowspans[col + dcol] = rowspan
                  except IndexError:
                      # rowspan or colspan outside the confines of the table
                      pass
  
          # update rowspan bookkeeping
          rowspans = {c: s - 1 for c, s in rowspans.items() if s &gt; 1}
  
      return table
  </code></pre>