Skip to content Skip to sidebar Skip to footer

Selenium Firefox Webdrive, Using Python, Scrolling In Div

I have been using python for a while, I want to save specific webpages which require prior login. Since this website uses javascript, I decided to use selenium for python with fire

Solution 1:

You can use WebDriver.execute_script to execute javascript:

eula = dr.find_element_by_id('eulaFrame')
dr.execute_script('arguments[0].scrollTop = arguments[0].scrollHeight', eula)

Arguments (eula in above example) passed to javascript can be accessed using arguments[..].

Side note: If you use return in the javascript code, that value is available as the return value of the execute_script.


Post a Comment for "Selenium Firefox Webdrive, Using Python, Scrolling In Div"