0

I am using Python 2.7. How could I check with python if there is more firefox windows opened? (firefox 37 and newer)

Especially I need to detect firefox POPUP windows (so not regular browser window) and then close it. [I know about popup blocking but this is not my way].

One option is to do it with image detection (I tried autopy module) but I prefer more programmatic approach. My OS is Windows and Linux.

UPDATE: This question is not related to mechanize and selenium - both are different things. I don't want to use selenium/mechanize but firefox.

peter
  • 4,289
  • 12
  • 44
  • 67
  • This might get you part of the way http://stackoverflow.com/questions/16428588/how-do-i-programmatically-check-for-open-browser-instances-on-a-windows-machine, but it won't tell you which is a window and which is a popup as there isn't a difference between popups and regularly opened windows at the process level. – scrappedcola Feb 04 '16 at 16:49
  • 1
    For detecting popups, check out: http://stackoverflow.com/questions/24206581/how-to-check-for-webpages-popups – Quinn Feb 04 '16 at 16:53
  • 1
    Hi there, mechanize and selenium are different things. I have no idea why somebody marked this question as duplicate. – peter Feb 04 '16 at 20:04

0 Answers0