title: What is the fastest way to open urls in new tabs via Selenium - Python?
body: <p>I want to create a python script to open up a lot tabs </p>
  
  <pre><code>import os
  import selenium
  from selenium import webdriver
  
  
  driver =webdriver.Chrome('/usr/local/bin/chromedriver')
  driver.execute_script("window.open('http://www.msn.com');")
  driver.execute_script("window.open('http://www.cnn.com');")
  driver.execute_script("window.open('http://www.yahoo.com');")
  driver.execute_script("window.open('https://www.apple.com');")
  driver.execute_script("window.open('https://www.google.com');")
  driver.execute_script("window.open('https://www.stackoverflow.com');")
  
  # driver.quit()
  </code></pre>
  
  <p>When I run I get </p>
  
  <p><a href="https://i.stack.imgur.com/7QNrW.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7QNrW.jpg" alt="enter image description here"></a></p>
  
  <p>Is what I have right now is the fastest way?</p>
  
  <hr>
  
  <p>I used to have this </p>
  
  <pre><code># -*- coding: utf-8 -*-
  
  import os
  import selenium
  from selenium import webdriver
  from selenium.webdriver.common.keys import Keys
  
  driver =webdriver.Chrome('/usr/local/bin/chromedriver')
  
  #1
  driver.get("http://msn.com")
  
  #2
  driver.find_element_by_tag_name('body').send_keys(Keys.COMMAND + 't')
  driver.switch_to.window(driver.window_handles[-1])
  driver.get("http://cnn.com")
  
  #3
  driver.find_element_by_tag_name('body').send_keys(Keys.COMMAND + 't')
  driver.switch_to.window(driver.window_handles[-1])
  driver.get("http://www.yahoo.com")
  
  #4
  driver.find_element_by_tag_name('body').send_keys(Keys.COMMAND + 't')
  driver.switch_to.window(driver.window_handles[-1])
  driver.get("https://www.apple.com")
  
  #5
  driver.find_element_by_tag_name('body').send_keys(Keys.COMMAND + 't')
  driver.switch_to.window(driver.window_handles[-1])
  driver.get("https://www.google.com")
  
  #6
  driver.find_element_by_tag_name('body').send_keys(Keys.COMMAND + 't')
  driver.switch_to.window(driver.window_handles[-1])
  driver.get("https://www.stackoverflow.com")
  </code></pre>
  
  <p>It works but it is painfully <code>slow</code>.</p>
  
  <hr>
  
  <p>I start with 6 now, but I want to load 100 tabs.</p>
  
  <p>Also, how do I get rid of my first weird looking tab? 
  I am even sure why it is there. </p>