0

I'm still a beginner with coding so maybe this question will be trivial for some of you. My apologies in advance.

For a project, i made a webcrawler using python and selenium, with an user interface made with Tkinter. I use a chromedriver to open chrome for the webcrawling part.

I converted my Tkinter file with pyinstaller into an executable file. When doing so, i typed the following flags: --onefile -w

I was told that the latter one prevents opening a command prompt when running the file, however, when i run the executable, my pc opens the command prompt for the chromedriver. How can i fix this?

Can Karakus
  • 21
  • 1
  • 6

1 Answers1

1

-w will prevent the creation of a console for the main exe, not for the execution of the chromedriver. You should have a look at ChromeDriver console application hide thread for removing the console created by chromedriver

Eric Mathieu
  • 631
  • 6
  • 11
  • Yeah i was able to figure that out, but do you know how i can fix this? I searched on stackoverflow and some said to change things in service.py of the selenium package, but that didn't work. – Can Karakus Jul 05 '20 at 10:06
  • 1
    Did you have a look to the link I provided ? It seemed to me that it could help you – Eric Mathieu Jul 05 '20 at 13:32
  • Thanks, I took a look at the link you provided. They talk about C# and i dont know how to translate their solution to python code. I also tried this: [link](https://stackoverflow.com/questions/33983860/hide-chromedriver-console-in-python), but that didnt help. However, i wonder if i have to save things in a special way in order for selenium to use the modified service.py. I just saved it and run my main file. Can that be the problem? – Can Karakus Jul 06 '20 at 10:17