title: Selenium code in PyCharm(Python) running slow, how to improve speed?
body: <p>I wrote this automated bot in PyCharm and I do not know why my code executes so slow? Any help for improvement is sincerely appreciated.</p>
  <pre><code>from selenium import webdriver
  from InfoApp import keys
  import time
  def order(k):
      driver = webdriver.Chrome(executable_path='driver/chromedriver')
      driver.get(k['product_url'])
      driver.maximize_window()
      driver.find_element_by_xpath('//*[@id=&quot;RightRail&quot;]/div/div[4]/fieldset/div/div[7]/label').click()
      driver.execute_script(&quot;window.scrollTo(0, 1000)&quot;)
      driver.find_element_by_xpath('//*[@id=&quot;floating-atc-wrapper&quot;]/div/button').click()
      driver.find_element_by_xpath('//*[@id=&quot;PDP&quot;]/div/div[4]/div/div/div/div/div/div/div/div/div/div[3]/div/button[2]').click()
      time.sleep(5)
      driver.find_element_by_xpath('//*[@id=&quot;nav-cart&quot;]/a/div/span').click()
      driver.find_element_by_xpath('//*[@id=&quot;react-root&quot;]/div/div[4]/button').click()
      driver.find_element_by_xpath('//*[@id=&quot;qa-guest-checkout&quot;]').click()
      driver.find_element_by_xpath('//*[@id=&quot;firstName&quot;]').send_keys(k[&quot;First_Name&quot;])
  
  if __name__ == '__main__':
      order(keys)
  </code></pre>