I am trying to print the result on the terminal but getting this error message:
IndexError: list index out of range
Below is the code, tha
You want to use the index i to iterate over names and address, not the list size
i
names
address
for i in range(num_page_items): print(f"{names[i].text} : {address[i].text}")
Or just loop on both with zip
zip
for name, ad in zip(names, address): print(f"{name.text} : {ad.text}")