Firefox と Python の Mozrepl アドオンを使用して、次のことを行います。
>>> import telnetlib
>>> tn = telnetlib.Telnet(r'127.0.0.1', 4242, 5)
>>> tn.read_eager()
'\nWelcome to MozRepl.\n\n - If you get stuck at the "'
>>> tn.read_until("repl> ")
...snip...
>>> tn.write(r'alert(window.content.location.href)'+"\n")
アクティブなタブの URL を含む警告ボックスが表示されます。しかし、その URL を Python 変数に読み込むにはどうすればよいでしょうか? のようなものですtn.write(r';var zz = window.content.location.href'+ "\n")
が、それはPythonには入りません。
助けていただければ幸いです。