rosuav at gmail.com
Sun Jul 14 01:26:13 CEST 2013
On Sun, Jul 14, 2013 at 6:49 AM, goldtech <leegold at operamail.com> wrote:
> With Mozrepl addon in Firefox and Python I do:
>>>> import telnetlib
>>>> tn = telnetlib.Telnet(r'127.0.0.1', 4242, 5)
> '\nWelcome to MozRepl.\n\n - If you get stuck at the "'
>>>> tn.read_until("repl> ")
> and I get an alert box with the URL of the active tab.
> But how do I read that URL into a python variable? Something like tn.write(r';var zz = window.content.location.href'+ "\n") but that doesn't get it into python.
> I would be grateful for help. Thanks.
This seems to be what you're after:
By my reading of that, this should do it:
It seems to function somewhat like Python's own interactive mode - a
bare expression gets sent to you. Very convenient.
More information about the Python-list