geturl - python, get current (dynamic) url -


so i've been tasked coming python script checks load time of pages in our application.. problem is, each page dynamic.

here example of 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 on... site has many different areas/url structures want able 'grab' current url (whatever is) , use that.

below script 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 can see, unable use generic "google.com". i've seen other posts getting current url seem based on idea know url in advance don't help.

i see there's 'get current url' in javascript need able python.

this needs python script i'm not sure if able use selenium calls

any suggestions?

thanks!


Comments