Skip to content

Instantly share code, notes, and snippets.

@kurozumi
Created May 27, 2017 03:10
Show Gist options
  • Save kurozumi/e050bd40177d0f74d1a70e01af3eac66 to your computer and use it in GitHub Desktop.
Save kurozumi/e050bd40177d0f74d1a70e01af3eac66 to your computer and use it in GitHub Desktop.
【Python】Seleniumでウィンドウサイズを取得する方法
from selenium.webdriver import Firefox
try:
driver = Firefox()
driver.get("https://a-zumi.net")
# 表示されたウィンドウの高さと幅、ウィンドウのx、y座標を取得します。
print(driver.get_window_rect())
except Exception as e:
print(e)
finally:
driver.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment