title: Iterate over a changing list length and append to another list
body: <p>I want to iterate over a beautifulsoup object that changes length based on the number of elements it finds matching the HTML tag.</p>
  <pre><code>driver.get('https://www.inspection.gc.ca/food-recall-warnings-and-allergy-alerts/2021-02-10/eng/1613010591343/1613010596418')
  page_source = driver.page_source
  
  soup = BeautifulSoup(page_source, 'html.parser')
  recall_details = soup.find('table', class_ = 'table table-bordered table-condensed')
  
  recalled_products = recall_details.find_all('td')
  recalled_products
  </code></pre>
  <p>Output:</p>
  <pre><code>[&lt;td&gt;One Ocean&lt;/td&gt;,
   &lt;td&gt;Sliced Smoked  Wild Sockeye Salmon&lt;/td&gt;,
   &lt;td&gt;300 g&lt;/td&gt;,
   &lt;td&gt;6 25984 00005 3&lt;/td&gt;,
   &lt;td&gt;11253&lt;/td&gt;]
  </code></pre>
  <p>I want to iterate over each td element and append to a list like this:</p>
  <pre><code>brands = []
  products = []
  sizes = []
  upcs = []
  codes = []
  
  brand = recalled_products[0].text
  product = recalled_products[1].text
  size = recalled_products[2].text
  upc = recalled_products[3].text
  code = recalled_products[4].text
  brands.append(brand)
  products.append(product)
  sizes.append(size)
  upcs.append(upc)
  codes.append(code)
  
  print(brands)
  print(products)
  print(sizes)
  print(upcs)
  print(codes)
  </code></pre>
  <p>Output:</p>
  <pre><code>['One Ocean']
  ['Sliced Smoked  Wild Sockeye Salmon']
  ['300\xa0g']
  ['6\xa025984\xa000005\xa03']
  ['11253']
  </code></pre>
  <p>I tried the following code, but I am not getting the expected result. I need some kind of counter I think.</p>
  <pre><code>for i in range(len(recalled_products)):
      brand = recalled_products[i].text
      product = recalled_products[i].text
      size = recalled_products[i].text
      upc = recalled_products[i].text
      code = recalled_products[i].text
      brands.append(brand)
      products.append(product)
      sizes.append(size)
      upcs.append(upc)
      codes.append(code)
  
  print(brands)
  print(products)
  print(sizes)
  print(upcs)
  print(codes)
  ```
  
  Output:
  
  ```
  ['One Ocean', 'Sliced Smoked  Wild Sockeye Salmon', '300\xa0g', '6\xa025984\xa000005\xa03', '11253']
  ['One Ocean', 'Sliced Smoked  Wild Sockeye Salmon', '300\xa0g', '6\xa025984\xa000005\xa03', '11253']
  ['One Ocean', 'Sliced Smoked  Wild Sockeye Salmon', '300\xa0g', '6\xa025984\xa000005\xa03', '11253']
  ['One Ocean', 'Sliced Smoked  Wild Sockeye Salmon', '300\xa0g', '6\xa025984\xa000005\xa03', '11253']
  ['One Ocean', 'Sliced Smoked  Wild Sockeye Salmon', '300\xa0g', '6\xa025984\xa000005\xa03', '11253']
  </code></pre>
  <p>This is a sample html code of the website
  <a href="https://i.stack.imgur.com/FlUfR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FlUfR.png" alt="enter image description here" /></a></p>
  <p>Thank you in advance for any help provided.</p>