Kalebu / alright

Python wrapper for WhatsApp web-based on selenium
https://www.youtube.com/watch?v=yitQTt-NukM
MIT License
355 stars 109 forks source link

Chrome failed to start: exited abnormally #61

Closed diopratama closed 1 year ago

diopratama commented 2 years ago

I tried to run in ubuntu with GUI installed and chrome installed, but it failed to start the chrome browser with following error:

Traceback (most recent call last): File "sample.py", line 5, in <module> messenger = WhatsApp() File "/usr/local/lib/python3.8/dist-packages/alright/__init__.py", line 33, in __init__ browser = webdriver.Chrome( File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/chrome/webdriver.py", line 70, in __init__ super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog", File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/chromium/webdriver.py", line 92, in __init__ RemoteWebDriver.__init__( File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/remote/webdriver.py", line 275, in __init__ self.start_session(capabilities, browser_profile) File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/remote/webdriver.py", line 365, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/remote/webdriver.py", line 430, in execute self.error_handler.check_response(response) File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/remote/errorhandler.py", line 247, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally. (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

Here is my code: `from alright import WhatsApp import time

msg = "hey I'm done its tuesday" messenger = WhatsApp() messenger.send_message1(628964323xxx, msg)`

The code is work on my Mac, any suggestion on this?

Thanks

euriconicacio commented 2 years ago

Hi, @diopratama!

Tbh, that's one of the things on the scope of identifying whether we have an existing browser session or not - checking what's the browser that should/will be used. Couple years ago, this would be certainly an issue solvable through xfvb appropriate configuration (when we could only use Chromium browser on Ubuntu, no Chrome at all); now, I'd go for an issue related to ChromeDriver being unable to spawn the WebBrowser.

Could you please attempt to reproduce the steps proposed in this solution and see if they make things work? (I'd bet a beer they do. Lol)

Thanks a lot for reporting! Developing multi-platform solutions is tough - multi-browser across multi-platform even more. Lol

Best regards,

nCKbr. [cc @Kalebu - fyk]