title: Print request made by selenium web driver
body: <p>Below is simple code that click the login button of wp-login page. I want to print the request that is being made by selenium on button click. Is it possible using selenium. If not is there any other possible way.</p>
  
  <pre><code>def init_driver():
      driver = webdriver.PhantomJS()
      driver.wait = WebDriverWait(driver, 5)
      return driver
  
  
  def clickButton(driver):
      driver.get("http://website.com/wp-login.php")
      try:
          button = driver.wait.until(EC.element_to_be_clickable(
              (By.NAME, "wp-submit")))
          button.click()
  
      except TimeoutException:
          print("Button not found in google.com")
  
  if __name__ == "__main__":
      driver = init_driver()
      clickButton(driver)
      driver.quit()
  </code></pre>
  
  <p>Below is the request that I capture on button click using burpsuite that I want to print in python:</p>
  
  <pre><code>POST /wp-login.php HTTP/1.1
  Host: website.com
  User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0
  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  Accept-Language: en-US,en;q=0.5
  Referer: http://website.com/wp-login.php
  Cookie: wordpress_test_cookie=WP+Cookie+check; AWSELB=7DdsfsdfsdsfgeredfgfebfgrehgfdcxBD20E6
  Connection: close
  Upgrade-Insecure-Requests: 1
  Content-Type: application/x-www-form-urlencoded
  Content-Length: 94
  
  
  log=&amp;pwd=&amp;wp-submit=Log+In&amp;redirect_to=http%3A%2F%2Fwebsite.com%2Fwp-admin%2F&amp;testcookie=1
  </code></pre>
  
  <p>Below solution does not work for me
  <a href="https://stackoverflow.com/questions/10588644/how-can-i-see-the-entire-http-request-thats-being-sent-by-my-python-application">How can I see the entire HTTP request that&#39;s being sent by my Python application?</a><br>
  As I wanted to print request on button click. </p>