Read active tab URL from a browser with Python ?

G

goldtech

Hi,

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...

Any help appreciated.

Lee G.
 
A

alex23

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/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top