I'm trying to webscrape replies to comments. Below is my code to load and click the "load more comments" btn.
load_replies =driver.find_elements_by_xpath("//div[@class='thread-node-children-show']/span")
for i in (load_replies):
WebDriverWait(driver, 10).until(EC.visibility_of(i))
i.click()
However, this only loads a few replies, and then I receive the error "Element could not be scrolled into view". I'm not sure how to fix the error. I've tried extending the load time, but that doesn't help.
Could you please help? For reference, I'm using Python. I should also add that prior to using the for loop, my code was :
WebDriverWait(driver,10).until(EC.element_to_be_clickable((By.XPATH,"//div[@class='thread-node-children-show']/span"))).click()
However, I added the for loop because without it, that line of code would only load the first reply instead of all the replies.
Thank You.