title: Getting current browser url using selenium and python and save it
body: <p>Using selenium and python. I am trying to get a URL and save it by doing this:</p>
  
  <pre><code>driver = webdriver.Firefox()
  driver.get("https://google.com")
  
  elem = driver.find_element(By.XPATH, "/html/body/div/div[3]/div[1]/div/div/div/div[1]/div[1]/a")
  elem.click()
  
  url = driver.current_url
  print url
  </code></pre>
  
  <p>url that prints is google.com and not the new clicked link which gmail.
  My question is, how can I get the second url and save it.</p>