For a concrete example of the problem, when I go to the following address in a regular browser:
http://www.aaai.org/ocs/index.php/SOCS/SOCS16/paper/viewFile/13951/13240
I get re-directed to https
:
https://www.aaai.org/ocs/index.php/SOCS/SOCS16/paper/viewFile/13951/13240
I tried the following in the Python interactive shell:
>>> from selenium import webdriver
>>> driver = webdriver.PhantomJS()
>>> driver.get("http://www.aaai.org/ocs/index.php/SOCS/SOCS16/paper/viewFile/13951/13240")
>>> driver.current_url
u'http://www.aaai.org/ocs/index.php/SOCS/SOCS16/paper/viewFile/13951/13240'
As is seen from the output, the re-direction did not happen. I waited a bit and issued driver.current_url
once again, but the same output came out. How do I cause Selenium to get re-directed the way it happens in a regular browser?
EDIT: I tried to send Selenium directly to the https
address and it would not go! Could it be because that url is a file? If this is a normal behavior, then how can I find out the file's url when I only have the http
link?