title: Python selenium get page title
body: <pre><code>from selenium import webdriver
  from selenium.webdriver.common.by import By
  from selenium.webdriver.support.ui import WebDriverWait
  from selenium.webdriver.support import expected_conditions as EC
  from selenium.webdriver.firefox.options import Options
  
  options = Options()
  options.headless = True
  driver = webdriver.Firefox(options=options)
  driver.get(&quot;https://hapondo.qa/rent/doha/apartments/studio&quot;)
  element = WebDriverWait(driver, 10).until(
      EC.presence_of_element_located((By.XPATH, &quot;/html/head/title&quot;))
  )
  
  print(element.text)
  </code></pre>
  <p>Unable to get page title under headless option? Tried to wait and even tried <code>driver.title</code></p>