title: BeautifulSoup4 IndexError: list index out of range?
body: <p>I am learning about BS4 and I can't figure out what this code does and why does this code throw out an error like this:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/home/ubuntu/workspace/Untitled1.py", line 17, in &lt;module&gt;
      for tr in soup.find_all('tr')[3]:
  IndexError: list index out of range
  </code></pre>
  
  <p>The python code using bs4 is:</p>
  
  <pre><code>for tr in soup.find_all('tr')[2]:
      tds = tr.find_all('td')
      print("value:%s,value 2:%s,value3:%s" \
          (tds[0].text,tds[1].text,tds[2].text))
  </code></pre>
  
  <p>Thank you so much for reading this post. </p>