As title says everything i am getting this error , sometime it comments and 100 posts and sometimes 2 or 3 than i get the same error upvote[count].click() IndexError: list index out of range even the class is in range
Basically what i am trying to do is automate commenting on Quora only for educational purpose , i tried searching everywhere but didn't found solution, some told me to add time.sleep() function and all but nothing working at all. please help me to solve this it will be much appreciated
You can see the image here where it shows the class where i want to add a comment

here is my code
driver = webdriver.Chrome("chromedriver.exe")
url = "https://quora.com/"
driver.get(url)
for i in range(200):
print(count)
wait = WebDriverWait(driver, 20)
upvote = wait.until(
EC.presence_of_all_elements_located((By.NAME, "Comment")))
upvote[count].click()
time.sleep(3)
click_comment_bar = wait.until(
EC.presence_of_all_elements_located((By.XPATH,"//*[@class='doc empty']")))
click_comment_bar[count].click()
comments = "Hello"
click_comment_bar[count].send_keys(comments)
time.sleep(3)
post_comment = wait.until(
EC.presence_of_all_elements_located((By.XPATH, "//*[@class='q-box qu-ml--tiny']")))
post_comment[count].click()
Error
Traceback (most recent call last):
File "c:\Users\quora.py.py", line 14
click_comment_bar[count].click()
IndexError: list index out of range
PS C:\Users\Quora> [7244:3456:0101/120500.531:ERROR:gpu_init.cc(457)] Passthrough is not
supported, GL is disabled, ANGLE is
countisn't defined in the posted code. When python says its out of range... its out of range. You could put the code in a try/except block and then print out information about upvote (e.g.,print(len(upvote))to see what you got.