Selenium Python | IndexError: list index out of range <p><strong>Problem Statement</strong>:- On the <a href="http://www.saksoff5th.com/laurel-nubuck-leather-belt/0492184735210.html?start=2&amp;cgid=Men#q=belts&amp;start=1&amp;location=0&amp;slotLoads=1" rel="nofollow">http://www.saksoff5th.com/laurel-nubuck-leather-belt/0492184735210.html?start=2&amp;cgid=Men#q=belts&amp;start=1&amp;location=0&amp;slotLoads=1</a> site, I am trying to add a size and choose color for an item so that I can proceed to the checkout. However, I am getting the error <code>list index out of range</code>. My code is:</p> <pre><code>selenium import webdriver from selenium.webdriver.common.keys import Keys import time browser = webdriver.Firefox() #Searches via Belts in the text box browser.get('http://www.saksoff5th.com') browser.find_element_by_id('q').send_keys('Belts' + Keys.RETURN) #Clicks the Men link browser.implicitly_wait(10) browser.find_element_by_link_text('Men').click() time.sleep(10) elemprodcl = browser.find_element_by_id('search-result-items') Listprdcl= elemprodcl.find_elements_by_class_name('grid-tile') elemprodcl2 = Listprdcl[1].find_element_by_class_name('product-tile') elemprodcl3 = elemprodcl2.find_element_by_class_name('product-image') elemprodcl4 = elemprodcl3.find_element_by_tag_name('a') elemprodcl4.find_element_by_tag_name('img').click() elemproddl = browser.find_element_by_class_name('swatches') print('yes') Listproddl = elemproddl.find_elements_by_class_name('selectable') print('yes1') Listproddl[1].click() print('yes2') elemclr = browser.find_element_by_class_name('Color') print('yes3') Listclr = elemclr.find_elements_by_class_name('selectable') print('yes4') Listclr[0].find_element_by_class_name('swatchanchor').click() print('yes5') Output as yes yes1 yes2 yes3 yes4 Traceback (most recent call last): File "C:\Python27\Off5th_Guest_Checkout", line 56, in &lt;module&gt; Listclr[0].find_element_by_class_name('swatchanchor').click() IndexError: list index out of range </code></pre>