get current url from browser python
Question: I am running an HTTP server which serves a bitmap according to the dimensions
in the browser url i.e localhost://image_x120_y30.bmp . My server is running
in infinite loop and I want to get the url any time user requests for BITMAP .
so , I can extract image dimensions from url.

The question asked here [How to get current URL in python web
page?](http://stackoverflow.com/questions/14468862/how-to-get-current-url-in-
python-web-page) does not address my problem as I am running in infinite loop
and I want to keep on getting the current url so I can deliver the requested
BITMAP to user.


Answer: If to use Selenium for web navigation:

    
    
    from selenium import webdriver
    driver = webdriver.Firefox()
    print (driver.current_url)
    

