I'm using Selenium with Python API and Firefox to do some automatic stuff, and here's my problem:
- Click a link on original page, let's say on page a.com
- I'm redirected to b.com/some/path?arg=value
- And immediately I'm redirected again to the final address c.com
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.