I'm using Selenium with Python API and Firefox to do some automatic stuff, and here's my problem:
So is there a way to get the intermediate redirect URL b.com/some/path?arg=value with Selenium Python API? I tried driver.current_url
but when the browser is on b.com, seems the browser is still under loading and the result returned only if the final address c.com is loaded.
Another question is that is there a way to add some event handlers to Selenium for like URL-change? Phantomjs has the capacity but I'm not sure for Selenium.
Answer my own question.
If the redirect chain is very long, consider to try the methods @alecxe and @Krishnan provided. But in this specific case, I've found a much easier workaround:
When the page finally landed c.com, use
driver.execute_script('return window.document.referrer')
to get the intermediate URL