so I've been tasked with coming up with a Python script that checks the load time of pages in our application.. problem is, each page is dynamic.
Here is an example of the pages: Page 1: https://<'sitename'>/<'area_of_site'>/5462174380064768/new-page/?industry=<'some_industrty_here'>
Page 2: https://<'sitename'>/<'another_area_of_site'>/54621743808484848/old-page/?industry=<'some_OTHER_industrty_here'>
And so on... the site has many different areas/url structures so I just want to be able to 'grab' the current url (whatever that is) and use that.
Below is the script I had been using:
stream = urllib2.urlopen('http://www.google.com')
start_time = time()
output = stream.read()
end_time = time()
stream.close()
print "Ping in ms = %r:" % (round(end_time-start_time, 3))
But as you can see, I am unable to use the generic "google.com". I've seen other posts about getting the current url but they all seem to be based on the idea that you know what the url is in advance so those don't really help.
I see there's a 'get current url' in Javascript but I need to be able to do this with Python.
This needs to be a Python script so I'm not sure if I will able to use Selenium calls
Any suggestions?
Thanks!