browser.execute_script("window.scrollTo(0,document.body.scrollHeight)")
while driver.find_element_by_tag_name('div'):
driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")
Divs=driver.find_element_by_tag_name('div').text
if 'End of Results' in Divs:
print 'end'
break
else:
continue
SCROLL_PAUSE_TIME = 0.5
# Get scroll height
last_height = driver.execute_script("return document.body.scrollHeight")
while True:
# Scroll down to bottom
driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")
# Wait to load page
time.sleep(SCROLL_PAUSE_TIME)
# Calculate new scroll height and compare with last scroll height
new_height = driver.execute_script("return document.body.scrollHeight")
if new_height == last_height:
break
last_height = new_height
Code Example |
---|
Python :: |
Python :: |
:: how to add new column in csv file using pandas |
Python :: |
:: |
:: Cast image to float32 |
Python :: |
:: |
Python :: |
:: |
:: |
:: django celery results |
:: |
:: python see if a number is greater than other |
:: |
Python :: |
Python :: python print without new lines |
Python :: |
:: |
:: |
:: |
:: |
:: |
Python :: |
:: |
:: |
:: how to check for a substring in python |
:: |
:: |
:: |