script = """rve
w content.location.href;
ru repl>
w repl.quit()
cl
"""
conn = telnetscript.telnetscript('127.0.0.1', {}, 4242)
ret = conn.RunScript(script.split('\n')).split('\n')
print(ret[-2][6:])
retrieving current URL from FireFox with python