Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
【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