Skip to content

Instantly share code, notes, and snippets.

@zac11
Created February 3, 2023 07:44
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 zac11/840a2a614e8b6ba045eaaf829935a434 to your computer and use it in GitHub Desktop.
Save zac11/840a2a614e8b6ba045eaaf829935a434 to your computer and use it in GitHub Desktop.
import time
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.chrome.service import Service
svc=Service(ChromeDriverManager().install())
driver = webdriver.Chrome(service=svc)
max_width, max_height = driver.execute_script("return [window.screen.availWidth, window.screen.availHeight];")
print(max_width,max_height)
time.sleep(3)
driver.set_window_size(max_width,max_height)
driver.get("https://selectorshub.com/xpath-practice-page/")
driver.implicitly_wait(20)
driver.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment