How can my Python script get the URL of the currently active Google Chrome tab in Windows? This has to be done without interrupting the user, so sending key strokes to copy/paste is not an option.
How can my Python script get the URL of the currently active Google Chrome tab in Windows? This has to be done without interrupting the user, so sending key strokes to copy/paste is not an option.
I quite new to StackOverFlow so apologies if the comment is out of tone.
After looking at :
I resulted in copy/pasting the History file itself (\AppData\Local\Google\Chrome\User Data\Default\History) into my application folder when the title of the window (retrieved using the hwnd + win32) is missing from "my" urls table. This can be done even if the sqlite db is locked and does not interfere with the user experience.
Very basic solution that requires : sqlite3, psutil, win32gui. Hope that helps.