Created
          January 13, 2020 13:04 
        
      - 
      
- 
        Save zhunhung/091106fd518d0458b50c582d71857d79 to your computer and use it in GitHub Desktop. 
    Script to verify selenium works
  
        
  
    
      This file contains hidden or 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
    
  
  
    
  | from selenium import webdriver | |
| from selenium.webdriver.chrome.options import Options | |
| CHROMEDRIVER_PATH = '/usr/local/bin/chromedriver' | |
| WINDOW_SIZE = "1920,1080" | |
| chrome_options = Options() | |
| chrome_options.add_argument("--headless") | |
| chrome_options.add_argument("--window-size=%s" % WINDOW_SIZE) | |
| chrome_options.add_argument('--no-sandbox') | |
| driver = webdriver.Chrome(executable_path=CHROMEDRIVER_PATH, | |
| chrome_options=chrome_options | |
| ) | |
| driver.get("https://www.google.com") | |
| print(driver.title) | |
| driver.close() | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment