Skip to content

Instantly share code, notes, and snippets.

@kurozumi
Last active February 24, 2016 10:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kurozumi/33fec8e44aced399900c to your computer and use it in GitHub Desktop.
Save kurozumi/33fec8e44aced399900c to your computer and use it in GitHub Desktop.
【Selenium】How to scroll down to the bottom of a page
# 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