BeautifulSoup4 IndexError: list index out of range?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


BeautifulSoup4 IndexError: list index out of range?



I am learning about BS4 and I can't figure out what this code does and why does this code throws out an error like this:


Traceback (most recent call last):
File "/home/ubuntu/workspace/Untitled1.py", line 17, in <module>
for tr in soup.find_all('tr')[3]:
IndexError: list index out of range



The python code using bs4 is:


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))



Thank you so much for reading this post.





Does soup.find_all('tr') return list with equal to /greater than 3 values ?
– Madhan M
3 mins ago


equal to /greater than









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Arduino Mega cannot recieve any sketches, stk500_recv() programmer is not responding

Visual Studio Code: How to configure includePath for better IntelliSense results

Better method to check all objects' parameters with a single call