Reputation: 17778
Is there a way to determine programmatically, using Python, which web page is currently active in Google Chrome?
Upvotes: 1
Views: 550
Reputation: 136
Google Chrome for Mac has added the AppleScripting method for getting the URL.
https://sites.google.com/a/chromium.org/dev/developers/design-documents/applescript
tell application "Google Chrome"
get URL of active tab of window 1
end tell
http://laclefyoshi.blogspot.com/2010/10/google-chrome-ver.html
Upvotes: 2
Reputation: 881635
Not yet, it seems. Such tasks are done, with other browsers, via the Applescript interface, but, as this thread shows, while hotly requested for Chrome on the Mac this feature is not there yet.
(Once a Mac app does get a good Applescript interface, there are several ways to use that interface from Python, without needing to actually involve Applescript as a language -- this has been touched upon on other SO questions about other apps -- but the problem is that Chrome in particular doesn't yet support this quintessentially Mac-ish functionality).
Given the insistence of the request I'd expect somebody to eventually roll up their sleeves and contribute a patch for the purpose, but it doesn't seem to have occurred yet.
Upvotes: 0