I had the same problem now, and I found a way that, in my opinion, is better than trying to send keys to PhantomJS.
Remember that PhantomJS is a browser without a browser - for your OS, a real window does not open with keyboard shortcuts.
, /, . .
( - ).
:
print(driver.window_handles)
driver.switch_to.window(driver.window_handles[1])
driver.switch_to.window(driver.window_handles[0])
current_url, , , :
assert "www.stackoverflow.com" in driver.current_url
: fooobar.com/questions/1579115/...