python - Measure the time a browser needs to open a url completely -


How can I measure a browser's need to open the specified URL? Also close the browser

I tried to:

  import time import webbrover start = time.time () webbrowser.open ('http: / /stackoverflow.com ') End = Time. Time () Print (End-Start)  

Python opens the URL in the default browser but the time is measured, it is time that the dragon needs to execute the code, not the browser How much time to start and to fully load the website?

What do I need:

  #start time measurement # open url Waiting for URL to finish loading # in the browser #if loading URL Ending is: Close browser and stop time measurement  

Is it also possible to realize this in Python? Any help is appreciated.

IMO, this is not possible with the module because the module can only open the browser window / tab and browser Does not provide control of

You need something.

For example:

  import time from the selenium import web driver driver = Webdriver.firefox () start = time.time () driver.get ('http: / /stackoverflow.com ') end = time.time () print (end-start) driver.quit ()  

Comments