ar-nadeem / WhatsApp-Selenium

A free opensource Whatsapp API for Python.
MIT License
8 stars 4 forks source link

I don't get this... #1

Open 0wwafa opened 1 month ago

0wwafa commented 1 month ago

I installed the chrome driver.. then when I issued: bot = Whatsapp(silent=True, headless=False) The browser window opened. I went to web.whatsapp.com and linked the device with my phone. The page opened... and immediately after the program crashes as you see below.

Also: when I tried again, the browser did not remember the previous device and asked me again to link a device.

>>> from Whatsapp import Whatsapp
User data will be saved in: UserData
>>> bot = Whatsapp(silent=True, headless=False)

DevTools listening on ws://127.0.0.1:14578/devtools/browser/3ea4345d-0e8b-429d-894e-9b5c20ae4a58
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "I:\WhatsApp-Selenium\Whatsapp.py", line 41, in __init__
    self.browser = webdriver.Chrome(options=self.options)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Robert\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 80, in __init__
    super().__init__(
  File "C:\Users\Robert\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 104, in __init__
    super().__init__(
  File "C:\Users\Robert\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 286, in __init__
    self.start_session(capabilities, browser_profile)
  File "C:\Users\Robert\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 378, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Robert\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 440, in execute
    self.error_handler.check_response(response)
  File "C:\Users\Robert\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 245, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: DevToolsActivePort file doesn't exist
Stacktrace:
        GetHandleVerifier [0x00007FF6DDD61F22+60322]
        (No symbol) [0x00007FF6DDCDCE99]
        (No symbol) [0x00007FF6DDB97EBA]
        (No symbol) [0x00007FF6DDBD49E4]
        (No symbol) [0x00007FF6DDBCED3D]
        (No symbol) [0x00007FF6DDBCAF74]
        (No symbol) [0x00007FF6DDC17934]
        (No symbol) [0x00007FF6DDC16F90]
        (No symbol) [0x00007FF6DDC0BFC3]
        (No symbol) [0x00007FF6DDBD9617]
        (No symbol) [0x00007FF6DDBDA211]
        GetHandleVerifier [0x00007FF6DE07946D+3301613]
        GetHandleVerifier [0x00007FF6DE0C3693+3605267]
        GetHandleVerifier [0x00007FF6DE0B9410+3563664]
        GetHandleVerifier [0x00007FF6DDE142F6+790390]
        (No symbol) [0x00007FF6DDCE74DF]
        (No symbol) [0x00007FF6DDCE33D4]
        (No symbol) [0x00007FF6DDCE3562]
        (No symbol) [0x00007FF6DDCD2F6F]
        BaseThreadInitThunk [0x00007FF8D8F67344+20]
        RtlUserThreadStart [0x00007FF8D90A26B1+33]
ar-nadeem commented 1 month ago

Did you get the same version of chrome driver as the system installed google chrome ?

0wwafa commented 1 month ago

Did you get the same version of chrome driver as the system installed google chrome ?

Did you get the same version of chrome driver as the system installed google chrome ?

hmm not sure.. I think I have the latest in both.. I'll check.. I thought the "driver" cotained a browser itself.