Last active
February 24, 2016 10:30
-
-
Save kurozumi/33fec8e44aced399900c to your computer and use it in GitHub Desktop.
【Selenium】How to scroll down to the bottom of a page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
from selenium import webdriver | |
# FireFox起動 | |
driver = webdriver.Firefox() | |
# yahoo表示 | |
driver.get('http://www.yahoo.co.jp/') | |
# javascriptを実行してページの最下部へ移動 | |
driver.execute_script("window.scrollTo(0, document.body.scrollHeight);") | |
# FireFox終了 | |
driver.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment