Read active tab URL from a browser with Python ?

alex23 wuwei23 at gmail.com
Tue Jul 2 21:38:34 EDT 2013


On 3/07/2013 10:51 AM, goldtech wrote:
> I've goggled this but haven't found a way (at least a way I understand) for a running Python script to get the current URL in a browser's location bar. Is there a way? I'm using Windows so maybe that would provide a way (or not).
> This isn't for a browser controlled/automated by Python that Pyhton might have a "hook" in, but just a "typical" running browser FF, IE...

Unfortunately, I don't think there's a simple, consistent way to do this 
without delving down into deep Windows COM voodoo like this:

http://stackoverflow.com/questions/2876755/get-name-of-active-excel-workbook-from-python

Another option might be to use Python in conjuction with AutoIt:

http://www.pha.com.au/kb/index.php/Using_AutoIT_with_Python
http://www.autoitscript.com/forum/topic/115293-how-to-get-firefox-current-page-address/



More information about the Python-list mailing list