2
browser.minimize_window() 

when it is not minimized, it can locate elements and download the file I want. but when I minimize it, it fails. why? How can I minimize it and still run the script successfully?

7
  • 2
    Selenium set aside - how would you locate any element in a minimized browser manually? I think your question does not make much sense. Commented Jan 7, 2022 at 13:05
  • ok. I can rephrase my question. How to minimize the chromedriver in selenium in a way that can locate elements. Is there any way? Or Can I run the chromedriver in a secondary monitor? I would prefer the minimized window option if that is possible Commented Jan 7, 2022 at 13:08
  • 3
    Why don't you use headless option instead of physically invoking the browser and then minimizing? Using headless does not open the browser to the front at all. In fact you'll not see the browser window. It just happens in the background and runs the code. Commented Jan 7, 2022 at 13:35
  • I think what you need is a headless browser to do this job, adding the flag --headless on the chromeoptions, if that is the case. Commented Jan 7, 2022 at 13:35
  • I know the headless option. I just wanted to make sure if there is any way to run the chromedriver minimized and execute the code. I wanted this because in this way I can look at the chromedriver when I want and see if my script is working correctly if needed. Headless won't allow that. But from the answers I suppose there is no way to make the chromedriver just minimize and work. Commented Jan 7, 2022 at 13:38

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.