On Quora, i want to scroll to the bottom of the window i am getting when clicking on view upvoters button, in order to get all upvoters names, the code for scrolling down a standard browser window does not seem to work with an overlay window, any suggestion? Here is my code for scrolldown function and for clicking on 'View upvoters' Button:
def scrolldown(browser):
src_updated = browser.page_source
src = ""
while src != src_updated:
src = src_updated
time.sleep(5)
browser.execute_script("window.scrollTo(0, document.body.scrollHeight);")
time.sleep(5)
src_updated = browser.page_source
#if (DEBUG): print ("window maximized...")
return browser
browser.get('https://www.quora.com/What-is-it-like-to-regret-having-children')
for p in browser.find_elements_by_class_name('AnswerVoterListModalLink'):
time.sleep(5)
p.click()
time.sleep(5)
browser=scrolldown(browser)
time.sleep(5)
c=0
for div in upvoter_name :#browser.find_elements_by_class_name('author_info'):
list_of_upvoters.append(div.find_element_by_class_name('user').text)
c+=1
print("number of upvoters for this answer is :" + str(c))