问题 I'm running OS X 10.11 , and I have created a web scraper using Python and Selenium . The scraper uses Firefox as the browser to collect data. The Firefox window must remain active at all critical steps, for the scraper to work. When I leave the computer with Firefox as the active window, when I return I often find that the active window focus has changed to something else. Some process is stealing the window focus. Is there a way that I can programatically tell the OS to activate the Firefox