2

I'm trying to open a window using selenium for some automation stuff, but i'm having trouble even getting the window to open up.

driver=webdriver.Chrome()
driver.get('https://www.youtube.com')

when I run this code I get the following error

Exception ignored in: <function Popen.__del__ at 0x04097858>
Traceback (most recent call last):
File "C:\python install\lib\subprocess.py", line 841, in __del__
self._internal_poll(_deadstate=_maxsize)
 File "C:\python install\lib\subprocess.py", line 1193, in _internal_poll
if _WaitForSingleObject(self._handle, 0) == _WAIT_OBJECT_0:
OSError: [WinError 6] The handle is invalid

When I run the code the chrome window opens, but then the error appears.

  • Are you sure that it is a firefox window? you have created Chrome driver though? – Sureshmani Kalirajan Oct 21 '19 at 15:24
  • Sorry, meant to say Chrome, i've tried firefox and the same error appears. – Liam Michel Oct 21 '19 at 15:28
  • Where is `chromedriver_win32.exe` installed? Have you added that installation directory to your Path? – CEH Oct 21 '19 at 16:52
  • Can you try mentioning chrome driver path in chrome driver initialization? ```browser = webdriver.Chrome('chromedriverpath')``` – Yosuva Arulanthu Oct 21 '19 at 17:27
  • I can only think this is more of a fork process error. Though the below link is no solution in this link for your problem https://stackoverflow.com/questions/40108816/python-running-as-windows-service-oserror-winerror-6-the-handle-is-invalid – john Oct 21 '19 at 21:57

0 Answers0