Getting errors when not using enumerate

why can’t we directly use for data in row_data instead of for idx,data in enumerate(row_data) in the second loop of the nested loops to fetch the data for rows

hey @shubhrs25_01611cd3f0e6aa02,
In the video did you see that we are not taking 1 and 4 index rows , hence for that case we used enumeration.

But if you don’t want to filter it in that way , then you can surely go without it.

https://drive.google.com/file/d/1GUIImk8Zf5XmnWtqACkiT_dfSfDZOvHk/view?usp=sharing for instance in this code, from line 21 to 25, as you can see rows data has just two th headers per row, when i try to access them and append them directly to a list i get index error, but when I access them and print them directly there is no error

but when i use enumerate as i did in the line 19 for the same problem, i get no errors and individual entires are appended succesfully

hey @shubhrs25_01611cd3f0e6aa02 ,
in the first cell you are just running without printing , hence it doesn’t tell you that either it reached at some point or not.

After running that cell ,
if you just do
row.findAll(‘th’)

you will get an empty list ,
which means there is no th tag in it , hence it is giving that error

So just check that , and see why it is as such

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.