Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

scroll down selenium python

browser.execute_script("window.scrollTo(0,document.body.scrollHeight)")
Comment

selenium webdriver scroll down python

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
Comment

Scroll a web page to bottom using selenium webdriver in python

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
Comment

PREVIOUS NEXT
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 
::  
::  
::  
ADD CONTENT
Topic
Content
Source link
Name
9+4 =